mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-07-16 01:47:20 +02:00
9 lines
205 B
TypeScript
9 lines
205 B
TypeScript
export const separate = <T>(array: T[], test: (element: T) => boolean) => {
|
|
const pass: T[] = [];
|
|
const fail: T[] = [];
|
|
|
|
array.forEach((i) => (test(i) ? pass : fail).push(i));
|
|
|
|
return [pass, fail];
|
|
};
|