MCPcopy Index your code
hub / github.com/formatjs/formatjs / parseOtherExtensionValue

Function parseOtherExtensionValue

packages/intl-getcanonicallocales/parser.ts:187–196  ·  view source on GitHub ↗
(chunks: string[])

Source from the content-addressed store, hash-verified

185 throw new RangeError('Malformed private_use_extension')
186}
187function parseOtherExtensionValue(chunks: string[]): string {
188 const exts = []
189 while (chunks.length && ALPHANUM_2_8.test(chunks[0])) {
190 exts.push(chunks.shift())
191 }
192 if (exts.length) {
193 return exts.join(SEPARATOR)
194 }
195 return ''
196}
197function parseExtensions(chunks: string[]): Omit<UnicodeLocaleId, 'lang'> {
198 if (!chunks.length) {
199 return {extensions: []}

Callers 1

parseExtensionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected