@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
10 lines (9 loc) • 418 B
TypeScript
/****
*
* separates an single array into an array of successes and an array of fails
* success is based on the truthiness of an predicate function
*
* successes are the first value of the return tuple
*****/
export declare function filterAndSeparate<TItem>(items: TItem[], predicate: (item: TItem) => boolean): readonly [TItem[], TItem[]];
export declare function findDuplicates<TItem>(items: TItem[]): TItem[];