Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// compact each tag to language-script with region if specified
const tag = parseLanguageTag(name);
const max = LanguageResolver.resolve(name);
id = `${max.language()}-${max.script()}`;
if (tag.hasRegion()) {
id = `${id}-${max.region()}`;
}
}
res.set(id, data);
ids.push(id);
}
res.forEach((_, id) => this.populate(res, id));
// Fill in the locales that have no RBNF mapping.
for (const locale of availableLocales()) {
const { tag } = locale;
const id = `${tag.language()}-${tag.script()}`;
if (res.has(id)) {
continue;
}
// Default to 'en-Latn' spellout
res.set(id, res.get('en-Latn')!);
ids.push(id);
}
this.core.push('root');
// Identify the rbnf rulesets that are globally-accessible. We need to
// ensure that each locale that requires one of these has the correct
// set of rbnf rulesets in its resource bundle.
const { NumberingSystems } = getSupplemental();