feat: delete partition.ts

This commit is contained in:
Jacob Nguyen
2022-05-15 16:04:58 -05:00
parent df1808cfb5
commit f6d584cf99

View File

@@ -1,8 +0,0 @@
export function partition<T, U extends T>(condition: (el: T) => el is U, array: T[]): [U[], T[]] {
const uArr: U[] = [];
const vArr: T[] = [];
for (const el of array) {
(condition(el) ? uArr : vArr).push(el);
}
return [uArr, vArr];
}