MCPcopy
hub / github.com/formatjs/formatjs / importedTailorings

Function importedTailorings

packages/intl-collator/compare.ts:257–273  ·  view source on GitHub ↗
(
  rule: PackedLDMLRule,
  visited: Set<string>
)

Source from the content-addressed store, hash-verified

255}
256
257function importedTailorings(
258 rule: PackedLDMLRule,
259 visited: Set<string>
260): readonly TailoringEntry[] {
261 if (
262 rule[0] !== 'setting' ||
263 rule[1] !== 'import' ||
264 typeof rule[2] !== 'string'
265 ) {
266 return []
267 }
268 // LDML [import] pulls rules from another language tag / collation type.
269 // The visited set prevents recursive imports from looping.
270 // https://www.unicode.org/reports/tr35/tr35-collation.html#Special_Purpose_Commands
271 const imported = IMPORT_COLLATION_RE.exec(rule[2])
272 return imported ? tailoringEntries(imported[1], imported[2], visited) : []
273}
274
275function addTailoredRelation(
276 entries: TailoringEntry[],

Callers 1

tailoringEntriesFunction · 0.85

Calls 1

tailoringEntriesFunction · 0.85

Tested by

no test coverage detected