MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / is_data_member_name

Function is_data_member_name

codegraph-kernel/src/tsjs/mod.rs:245–252  ·  view source on GitHub ↗

OBJECT_DATA_MEMBER_NAME (tree-sitter.ts, #3408): a key that reads as a name, `/^[A-Za-z_$][A-Za-z0-9_$]*$/` — `timeoutMs`, `'timeout_ms'`; not `'en-US'`, `'/checkout'` or `42`.

(name: &str)

Source from the content-addressed store, hash-verified

243/// `/^[A-Za-z_$][A-Za-z0-9_$]*$/` — `timeoutMs`, `'timeout_ms'`; not `'en-US'`,
244/// `'/checkout'` or `42`.
245fn is_data_member_name(name: &str) -> bool {
246 let mut bytes = name.bytes();
247 match bytes.next() {
248 Some(b) if b.is_ascii_alphabetic() || b == b'_' || b == b'$' => {}
249 _ => return false,
250 }
251 bytes.all(|b| b.is_ascii_alphanumeric() || b == b'_' || b == b'$')
252}
253
254/// HOST_GLOBAL_ROOTS (tree-sitter.ts, #2300): `window.App = {…}` defines the
255/// global `App`. (`self` is usually `var self = this` in page code, not the global.)

Callers 1

Calls 3

bytesMethod · 0.80
nextMethod · 0.80
allMethod · 0.65

Tested by

no test coverage detected