From 0ec0af67b14054d631608b3462618efdb19eccaf Mon Sep 17 00:00:00 2001 From: Rob LaFeve Date: Wed, 31 Jul 2024 17:00:26 -0500 Subject: [PATCH] fix: use Array.from when converting Set (#5428) --- .changeset/early-singers-begin.md | 5 +++++ packages/core/src/utilities/findDuplicates.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/early-singers-begin.md diff --git a/.changeset/early-singers-begin.md b/.changeset/early-singers-begin.md new file mode 100644 index 000000000..2b37530fa --- /dev/null +++ b/.changeset/early-singers-begin.md @@ -0,0 +1,5 @@ +--- +"@tiptap/core": patch +--- + +fix(core): findDuplicates - use Array.from when converting Set diff --git a/packages/core/src/utilities/findDuplicates.ts b/packages/core/src/utilities/findDuplicates.ts index 8f1f08133..a506e0d34 100644 --- a/packages/core/src/utilities/findDuplicates.ts +++ b/packages/core/src/utilities/findDuplicates.ts @@ -1,5 +1,5 @@ export function findDuplicates(items: any[]): any[] { const filtered = items.filter((el, index) => items.indexOf(el) !== index) - return [...new Set(filtered)] + return Array.from(new Set(filtered)) }