refactor: build system

This commit is contained in:
2023-05-31 14:04:05 +02:00
parent 4df19e8c20
commit 8cb9285462
427 changed files with 3973 additions and 9805 deletions
+2 -5
View File
@@ -17,15 +17,12 @@
* Partitions a list into two lists. One with the elements that satisfy a predicate,
* and one with the elements that don't satisfy the predicate.
*/
export function partition<T>(
array: T[],
transform: (item: T) => boolean
): [T[], T[]] {
export function partition<T>(array: T[], transform: (item: T) => boolean): [T[], T[]] {
return array.reduce<[T[], T[]]>(
(accumulator, item) => {
accumulator[transform(item) ? 0 : 1].push(item);
return accumulator;
},
[[], []]
[[], []],
);
}