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

Function stringToCodePoints

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

Source from the content-addressed store, hash-verified

62}
63
64function stringToCodePoints(input: string): number[] {
65 const codePoints: number[] = []
66 for (let i = 0; i < input.length; i++) {
67 const codePoint = input.codePointAt(i)
68 if (codePoint === undefined) {
69 continue
70 }
71 codePoints.push(codePoint)
72 if (codePoint > 0xffff) {
73 i++
74 }
75 }
76 return codePoints
77}
78
79function fallbackElement(codePoint: number): PackedCollationElement {
80 // UCA requires an order for code points not in the explicit root table; this

Callers 3

rootElementsForStringFunction · 0.85
addTailoredRelationFunction · 0.85
collationElementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected