diff --git a/src/util.ts b/src/util.ts index 2ccbef61..57015fa7 100644 --- a/src/util.ts +++ b/src/util.ts @@ -41,5 +41,7 @@ export function compact(a: (T | undefined)[]): T[] { } export function uniq(arr: T[]): T[] { - return arr.filter((a, i) => arr.findIndex(b => b === a) === i) + return arr.filter((a, i) => { + return !arr.find((b, j) => j > i && b === a) + }) }