MCPcopy
hub / github.com/formatjs/formatjs / levelCount

Function levelCount

packages/intl-collator/compare.ts:401–416  ·  view source on GitHub ↗
(slots: IntlCollatorInternal)

Source from the content-addressed store, hash-verified

399}
400
401function levelCount(slots: IntlCollatorInternal): number {
402 // ECMA-402 sensitivity selects how many UCA levels participate in
403 // CompareStrings: base=primary, accent=primary+secondary,
404 // case/variant include tertiary handling in this compact implementation.
405 // https://tc39.es/ecma402/#sec-properties-of-intl-collator-instances
406 switch (slots.sensitivity) {
407 case 'base':
408 return 1
409 case 'accent':
410 return 2
411 case 'case':
412 return 3
413 default:
414 return 4
415 }
416}
417
418function compareCollationElements(
419 left: readonly PackedCollationElement[],

Callers 1

comparePreparedStringsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected