From c31d9a73428e6386a4b0e3e848ba97b0dfc5dc85 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Tue, 6 Feb 2018 15:57:57 -0800 Subject: [PATCH] fix: uniq commandIDs --- src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 309a6817..0e5fcb0d 100644 --- a/src/util.ts +++ b/src/util.ts @@ -25,5 +25,5 @@ export function compact(a: (T | undefined)[]): T[] { } export function uniq(arr: T[]): T[] { - return arr.filter(a => arr.includes(a)) + return arr.filter((a, i) => arr.findIndex(b => b === a) === i) }