obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
26 lines (25 loc) • 685 B
text/typescript
/**
* @packageDocumentation
*
* Array utilities.
*/
/**
* Filter an array in place.
*
* @param arr - The array to filter.
* @param predicate - The predicate to filter the array.
*/
export declare function filterInPlace<T>(arr: T[], predicate: (value: T, index: number, array: T[]) => boolean): void;
/**
* Remove duplicates from an array.
*
* @param arr - The array to remove duplicates from.
* @returns The array with duplicates removed.
*/
export declare function unique<T>(arr: readonly T[]): T[];
/**
* Remove duplicates from an array in place.
*
* @param arr - The array to remove duplicates from.
*/
export declare function uniqueInPlace(arr: unknown[]): void;