First working version

This commit is contained in:
Sebastian Seedorf
2022-08-08 23:12:11 +02:00
parent 78dcee42ca
commit 940149cec8
22 changed files with 12436 additions and 1586 deletions

12
src/utils.ts Normal file
View File

@@ -0,0 +1,12 @@
export function isNonNullable<T>(any: T): any is NonNullable<T> {
return any !== undefined && any !== null
}
export function sortByProperty<T>(transform: (val: T) => number | string): (a: T, b: T) => number {
return (a, b) => {
const a2 = transform(a)
const b2 = transform(b)
if (a2 > b2) return 1
return a2 === b2 ? 0 : -1
}
}