(p: CodePointPredicate)
| 30 | type CodePointPredicate = (codePoint: number) => boolean; |
| 31 | |
| 32 | function 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 |
| 43 | export function utf16ConcatMap(mapper: (utf16Unit: number) => string): (s: string) => string { |
no outgoing calls
no test coverage detected
searching dependent graphs…