Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const i18n = require('../lib/i18n/i18n.js');
const lookupClosestLocale = require('lookup-closest-locale');
const cldrAliasData = require('cldr-core/supplemental/aliases.json');
const cldrAliases = cldrAliasData.supplemental.metadata.alias.languageAlias;
const cldrParentsData = require('cldr-core/supplemental/parentLocales.json');
const cldrParentLocales = cldrParentsData.supplemental.parentLocales.parentLocale;
// const
// Object.entries(cldrAliases).forEach(([alias, entry]) => { if (locales[entry._replacement]) console.log(alias, entry) })
const lhLocales = glob
.sync('./lighthouse-core/lib/i18n/locales/*.json')
.filter(f => !f.includes('.ctc.json'))
.map(filename => path.parse(filename).name);
//
// 1. Validate the locales we store are canonical and not an alias
//