UNPKG

browser-language-detector

Version:

A lightweight cross-browser JavaScript library for detecting browser and user language

7 lines 269 B
const uniq = array => array.reduce((a, b) => { if (a.indexOf(b) < 0) a.push(b); return a; }, []); const simplify = locale => locale.replace(/-.*/, '').toLowerCase(); const flatten = (array = []) => Array.prototype.concat(...array); export {uniq, simplify, flatten};