Add pretty formatting (#29)

* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
This commit is contained in:
Martin Braquet
2026-02-20 17:32:27 +01:00
committed by GitHub
parent 1994697fa1
commit ba9b3cfb06
695 changed files with 22382 additions and 23209 deletions

View File

@@ -1,4 +1,4 @@
import {MAX_INT} from "common/constants";
import {MAX_INT} from 'common/constants'
export function getSortedOptions(options: string[], order: string[] | Record<string, string>) {
let parsedOrder: string[]
@@ -7,14 +7,12 @@ export function getSortedOptions(options: string[], order: string[] | Record<str
} else {
parsedOrder = Object.keys(order)
}
return options
.slice()
.sort((a, b) => {
const ia = parsedOrder.indexOf(a as any)
const ib = parsedOrder.indexOf(b as any)
const sa = ia === -1 ? MAX_INT : ia
const sb = ib === -1 ? MAX_INT : ib
if (sa !== sb) return sa - sb
return String(a).localeCompare(String(b))
});
}
return options.slice().sort((a, b) => {
const ia = parsedOrder.indexOf(a as any)
const ib = parsedOrder.indexOf(b as any)
const sa = ia === -1 ? MAX_INT : ia
const sb = ib === -1 ? MAX_INT : ib
if (sa !== sb) return sa - sb
return String(a).localeCompare(String(b))
})
}