mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 03:26:57 +02:00
refactor: improve setup of type declaration files (#5914)
This commit is contained in:
parent
334470b5d4
commit
d1308a8736
33 changed files with 872 additions and 868 deletions
|
@ -21,3 +21,13 @@ export function duplicates<T>(
|
|||
(v, vIndex) => arr.findIndex((u) => comparator(u, v)) !== vIndex,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove duplicate array items (similar to _.uniq)
|
||||
* @param arr The array.
|
||||
* @returns An array with duplicate elements removed by reference comparison.
|
||||
*/
|
||||
export function uniq<T>(arr: T[]): T[] {
|
||||
// Note: had problems with [...new Set()]: https://github.com/facebook/docusaurus/issues/4972#issuecomment-863895061
|
||||
return Array.from(new Set(arr));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue