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

Function isIdentifier

lib/internal/repl/completion.js:86–105  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

84);
85
86function isIdentifier(str) {
87 if (str === '') {
88 return false;
89 }
90 const first = StringPrototypeCodePointAt(str, 0);
91 if (!isIdentifierStart(first)) {
92 return false;
93 }
94 const firstLen = first > 0xffff ? 2 : 1;
95 for (let i = firstLen; i < str.length; i += 1) {
96 const cp = StringPrototypeCodePointAt(str, i);
97 if (!isIdentifierChar(cp)) {
98 return false;
99 }
100 if (cp > 0xffff) {
101 i += 1;
102 }
103 }
104 return true;
105}
106
107function isNotLegacyObjectPrototypeMethod(str) {
108 return isIdentifier(str) &&

Callers 1

Calls 1

isIdentifierStartFunction · 0.85

Tested by

no test coverage detected