MCPcopy
hub / github.com/BrainJS/brain.js / isInAstralSet

Function isInAstralSet

browser.js:17776–17784  ·  view source on GitHub ↗
(code, set)

Source from the content-addressed store, hash-verified

17774// assumption is that looking up astral identifier characters is
17775// rare.
17776function isInAstralSet(code, set) {
17777 var pos = 0x10000;
17778 for (var i = 0; i < set.length; i += 2) {
17779 pos += set[i];
17780 if (pos > code) { return false }
17781 pos += set[i + 1];
17782 if (pos >= code) { return true }
17783 }
17784}
17785
17786// Test whether a given character code starts an identifier.
17787

Callers 2

isIdentifierStartFunction · 0.85
isIdentifierCharFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected