MCPcopy
hub / github.com/formatjs/formatjs / comparePreparedStrings

Function comparePreparedStrings

packages/intl-collator/compare.ts:448–464  ·  view source on GitHub ↗
(
  left: string,
  right: string,
  slots: IntlCollatorInternal
)

Source from the content-addressed store, hash-verified

446}
447
448function comparePreparedStrings(
449 left: string,
450 right: string,
451 slots: IntlCollatorInternal
452): number {
453 const locale = localeBase(slots.locale)
454 const tailoring = tailoringEntries(
455 locale,
456 collationForComparison(locale, slots.collation)
457 )
458 return compareCollationElements(
459 collationElements(left, tailoring),
460 collationElements(right, tailoring),
461 levelCount(slots),
462 slots.ignorePunctuation
463 )
464}
465
466function compareNumeric(
467 left: string,

Callers 2

compareNumericFunction · 0.85
compareCollatorStringsFunction · 0.85

Calls 6

localeBaseFunction · 0.85
tailoringEntriesFunction · 0.85
collationForComparisonFunction · 0.85
compareCollationElementsFunction · 0.85
collationElementsFunction · 0.85
levelCountFunction · 0.85

Tested by

no test coverage detected