MCPcopy Index your code
hub / github.com/nodejs/node / lookupInUnicodeMap

Function lookupInUnicodeMap

test/fixtures/snapshot/typescript.js:10219–10243  ·  view source on GitHub ↗
(code, map)

Source from the content-addressed store, hash-verified

10217 */
10218 var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
10219 function lookupInUnicodeMap(code, map) {
10220 // Bail out quickly if it couldn't possibly be in the map.
10221 if (code < map[0]) {
10222 return false;
10223 }
10224 // Perform binary search in one of the Unicode range maps
10225 var lo = 0;
10226 var hi = map.length;
10227 var mid;
10228 while (lo + 1 < hi) {
10229 mid = lo + (hi - lo) / 2;
10230 // mid has to be even to catch a range's beginning
10231 mid -= mid % 2;
10232 if (map[mid] <= code && code <= map[mid + 1]) {
10233 return true;
10234 }
10235 if (code < map[mid]) {
10236 hi = mid;
10237 }
10238 else {
10239 lo = mid + 2;
10240 }
10241 }
10242 return false;
10243 }
10244 /* @internal */ function isUnicodeIdentifierStart(code, languageVersion) {
10245 return languageVersion >= 2 /* ScriptTarget.ES2015 */ ?
10246 lookupInUnicodeMap(code, unicodeESNextIdentifierStart) :

Callers 2

isUnicodeIdentifierStartFunction · 0.85
isUnicodeIdentifierPartFunction · 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…