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

Function precomputedCodePointPredicate

src/Strings.ts:32–40  ·  view source on GitHub ↗
(p: CodePointPredicate)

Source from the content-addressed store, hash-verified

30type CodePointPredicate = (codePoint: number) => boolean;
31
32function precomputedCodePointPredicate(p: CodePointPredicate): CodePointPredicate {
33 const asciiResults: boolean[] = [];
34 for (let cp = 0; cp < 128; cp++) {
35 asciiResults.push(p(cp));
36 }
37 return function(cp: number) {
38 return cp < 128 ? asciiResults[cp] : p(cp);
39 };
40}
41
42// FIXME: This is a copy of code in src/Data/String/Util.js
43export function utf16ConcatMap(mapper: (utf16Unit: number) => string): (s: string) => string {

Callers 1

Strings.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…