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

Function parseKeyword

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

Source from the content-addressed store, hash-verified

126}
127
128function parseKeyword(chunks: string[]): KV | undefined {
129 let key
130 if (!KEY_REGEX.test(chunks[0])) {
131 return
132 }
133 key = chunks.shift()!
134
135 const type = []
136 while (chunks.length && TYPE_REGEX.test(chunks[0])) {
137 type.push(chunks.shift())
138 }
139 let value: string = ''
140 if (type.length) {
141 value = type.join(SEPARATOR)
142 }
143 return [key, value]
144}
145
146function parseTransformedExtension(chunks: string[]): TransformedExtension {
147 let lang: UnicodeLanguageId | undefined

Callers 1

parseUnicodeExtensionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected