fix(v2): fix theme array deduplication bug (#5000)

This commit is contained in:
Sébastien Lorber 2021-06-18 11:53:11 +02:00 committed by GitHub
parent fb172dc4e6
commit ba65450571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 5 deletions

View 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));
}