MCPcopy
hub / github.com/formatjs/formatjs / emitUnicodeLanguageId

Function emitUnicodeLanguageId

packages/intl-getcanonicallocales/emitter.ts:6–13  ·  view source on GitHub ↗
(lang?: UnicodeLanguageId)

Source from the content-addressed store, hash-verified

4} from '#packages/intl-getcanonicallocales/types.js'
5
6export function emitUnicodeLanguageId(lang?: UnicodeLanguageId): string {
7 if (!lang) {
8 return ''
9 }
10 return [lang.lang, lang.script, lang.region, ...(lang.variants || [])]
11 .filter(Boolean)
12 .join('-')
13}
14
15export function emitUnicodeLocaleId({
16 lang,

Callers 5

addLikelySubtagsFunction · 0.90
removeLikelySubtagsFunction · 0.90
baseNameMethod · 0.90
emitUnicodeLocaleIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected