MCPcopy
hub / github.com/formatjs/formatjs / formatLocales

Function formatLocales

tools/generate-cldr-locales.ts:62–71  ·  view source on GitHub ↗
(variable: string, locales: string[])

Source from the content-addressed store, hash-verified

60}
61
62function formatLocales(variable: string, locales: string[]): string {
63 const lines = [
64 '# Generated by //tools:generate-cldr-locales. Do not edit manually.',
65 `${variable} = [`,
66 ...locales.map(locale => ` "${locale}",`),
67 ']',
68 '',
69 ]
70 return lines.join('\n')
71}
72
73function main(args: Args) {
74 const {cldrPackage, jsonPath, out, variable = 'ALL_LOCALES'} = args

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected