mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 05:28:43 +02:00
fix(v2): fix theme array deduplication bug (#5000)
This commit is contained in:
parent
fb172dc4e6
commit
ba65450571
5 changed files with 51 additions and 5 deletions
12
packages/docusaurus-utils-common/src/uniq.ts
Normal file
12
packages/docusaurus-utils-common/src/uniq.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// Remove duplicate array items (similar to _.uniq)
|
||||
export default function uniq<T>(array: T[]): T[] {
|
||||
// Note: had problems with [...new Set()]: https://github.com/facebook/docusaurus/issues/4972#issuecomment-863895061
|
||||
return Array.from(new Set(array));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue