mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-12 07:04:45 +08:00
Added user themes section to Theme settings
This commit is contained in:
11
client/src/utility/arrayPartition.ts
Normal file
11
client/src/utility/arrayPartition.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export const arrayPartition = <T>(
|
||||
arr: T[],
|
||||
isValid: (e: T) => boolean
|
||||
): T[][] => {
|
||||
let pass: T[] = [];
|
||||
let fail: T[] = [];
|
||||
|
||||
arr.forEach((e) => (isValid(e) ? pass : fail).push(e));
|
||||
|
||||
return [pass, fail];
|
||||
};
|
||||
@@ -13,3 +13,4 @@ export * from './decodeToken';
|
||||
export * from './applyAuth';
|
||||
export * from './escapeRegex';
|
||||
export * from './parseTheme';
|
||||
export * from './arrayPartition';
|
||||
|
||||
Reference in New Issue
Block a user