refactor: build system

This commit is contained in:
2023-03-22 11:45:30 +01:00
parent 4df19e8c20
commit 8cb9285462
427 changed files with 3978 additions and 9810 deletions

View File

@@ -16,7 +16,7 @@
/**
* sort function for two strings
*/
export function stringSort(a = "", b = ""): number {
export function stringSort(a = '', b = ''): number {
if (a < b) return -1;
if (a > b) return 1;
return 0;
@@ -25,12 +25,10 @@ export function stringSort(a = "", b = ""): number {
/**
* sort function for two strings that allows for a custom transform
*/
export function stringSortBy<T>(
map: (item: T) => string | undefined
): (a: T, b: T) => number {
export function stringSortBy<T>(map: (item: T) => string | undefined): (a: T, b: T) => number {
return (a: T, b: T): number => {
const aValue = map(a) || "";
const bValue = map(b) || "";
const aValue = map(a) || '';
const bValue = map(b) || '';
if (aValue < bValue) return -1;
if (aValue > bValue) return 1;
return 0;