Skip to content

Commit

Permalink
fix(ie11): removes "Array.from()" and "new Set()"
Browse files Browse the repository at this point in the history
The TypeScript transpilation process polyfills many things,
like the spread operator (...array), or for...of, but it does
not for Array.from and new Set(). This was breaking
behavior in IE11.
  • Loading branch information
Cauli Tomaz committed Apr 29, 2020
1 parent 0976b4e commit 75283e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/locale/matchers/LocaleMatcherDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ class LocaleMatcherDefault implements Matcher {
});

const converted = candidates
.filter((el, i, a) => i === a.indexOf(el)) // deduplicate
.map(candidate => Locale.parse(candidate))
.filter(l => !l.hasParseError());

return Array.from(new Set(converted));
return converted;
}
}

Expand Down

0 comments on commit 75283e9

Please sign in to comment.