MCPcopy Create free account
hub / github.com/glideapps/quicktype / utf16LegalizeCharacters

Function utf16LegalizeCharacters

src/Strings.ts:127–129  ·  view source on GitHub ↗
(isLegal: (utf16Unit: number) => boolean)

Source from the content-addressed store, hash-verified

125}
126
127export function utf16LegalizeCharacters(isLegal: (utf16Unit: number) => boolean): (s: string) => string {
128 return utf16ConcatMap(u => (isLegal(u) ? String.fromCharCode(u) : ""));
129}
130
131export function legalizeCharacters(isLegal: (codePoint: number) => boolean): (s: string) => string {
132 return utf32ConcatMap(u => (u <= 0xffff && isLegal(u) ? String.fromCharCode(u) : ""));

Callers 3

Java.tsFile · 0.90
TypeScript.tsFile · 0.90
CSharp.tsFile · 0.90

Calls 1

utf16ConcatMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…