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

Function rootElementsForString

packages/intl-collator/compare.ts:234–243  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

232}
233
234function rootElementsForString(input: string): PackedCollationElement[] {
235 const codePoints = stringToCodePoints(input)
236 const elements: PackedCollationElement[] = []
237 for (let i = 0; i < codePoints.length; ) {
238 const match = lookupRootElements(codePoints, i)
239 elements.push(...match.elements)
240 i += match.length
241 }
242 return elements
243}
244
245function packedCollation(
246 locale: string,

Callers 1

addTailoredRelationGroupFunction · 0.85

Calls 2

stringToCodePointsFunction · 0.85
lookupRootElementsFunction · 0.85

Tested by

no test coverage detected