MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / matchesSymbol

Function matchesSymbol

src/math-json/utils.ts:515–520  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

513
514/** True if the string matches the expected pattern for a symbol */
515export function matchesSymbol(s: string): boolean {
516 return (
517 /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(s) ||
518 (s.length >= 2 && s[0] === '`' && s[s.length - 1] === '`')
519 );
520}
521
522export function matchesString(s: string): boolean {
523 if (s.length >= 2 && s[0] === "'" && s[s.length - 1] === "'") {

Callers 8

jsonMethod · 0.90
boxFunction · 0.90
serializeJsonStringFunction · 0.90
serializeJsonSymbolFunction · 0.90
parseFunction · 0.90
stringValueFunction · 0.85
symbolFunction · 0.85
matchesStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected