mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-13 20:14:56 +02:00
23 lines
889 B
TypeScript
23 lines
889 B
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
/**
|
|
* Gets the duplicate values in an array.
|
|
* @param arr The array.
|
|
* @param comparator Compares two values and returns `true` if they are equal
|
|
* (duplicated).
|
|
* @returns Value of the elements `v` that have a preceding element `u` where
|
|
* `comparator(u, v) === true`. Values within the returned array are not
|
|
* guaranteed to be unique.
|
|
*/
|
|
export declare function duplicates<T>(arr: readonly T[], comparator?: (a: T, b: T) => boolean): T[];
|
|
/**
|
|
* Remove duplicate array items (similar to `_.uniq`)
|
|
* @param arr The array.
|
|
* @returns An array with duplicate elements removed by reference comparison.
|
|
*/
|
|
export declare function uniq<T>(arr: T[]): T[];
|
|
//# sourceMappingURL=jsUtils.d.ts.map
|