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

Method parseValue

src/common/json5.ts:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 }
22
23 parseValue(): any {
24 this.skipWhitespace();
25 if (this.isAtEnd()) {
26 throw this.error('Unexpected end of input');
27 }
28 const ch = this.currentChar();
29 if (ch === '{') return this.parseObject();
30 if (ch === '[') return this.parseArray();
31 if (ch === '"' || ch === "'") return this.parseString();
32 if (ch === '-' || ch === '+' || (ch >= '0' && ch <= '9') || ch === '.')
33 return this.parseNumber();
34 return this.parseIdentifier();
35 }
36
37 private parseObject(): any {
38 const obj: Record<string, any> = {};

Callers 3

parseMethod · 0.95
parseObjectMethod · 0.95
parseArrayMethod · 0.95

Calls 9

skipWhitespaceMethod · 0.95
isAtEndMethod · 0.95
errorMethod · 0.95
currentCharMethod · 0.95
parseObjectMethod · 0.95
parseArrayMethod · 0.95
parseStringMethod · 0.95
parseNumberMethod · 0.95
parseIdentifierMethod · 0.95

Tested by

no test coverage detected