MCPcopy Create free account
hub / github.com/hey-api/hey-api / _isNodeName

Method _isNodeName

packages/openapi-python/src/py-dsl/stmt/try.ts:218–227  ·  view source on GitHub ↗

* Heuristic: a value is a `NodeName` (intended as the `as` variable) * if it is a plain string matching a Python identifier pattern, or a * Symbol.

(value: unknown)

Source from the content-addressed store, hash-verified

216 * Symbol.
217 */
218 private _isNodeName(value: unknown): boolean {
219 if (typeof value === 'string') {
220 return /^[A-Za-z_]\w*$/.test(value);
221 }
222 // Symbols from codegen-core have `~brand`
223 if (value && typeof value === 'object' && '~brand' in value) {
224 return true;
225 }
226 return false;
227 }
228}

Callers 1

exceptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected