MCPcopy
hub / github.com/graphql/graphiql / parseVal

Function parseVal

packages/codemirror-graphql/src/utils/jsonParse.ts:118–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118function parseVal(): ParseValueOutput | undefined {
119 switch (kind) {
120 case '[':
121 return parseArr();
122 case '{':
123 return parseObj();
124 case 'String':
125 case 'Number':
126 case 'Boolean':
127 case 'Null':
128 const token = curToken();
129 lex();
130 return token;
131 }
132 expect('Value');
133}
134
135function curToken(): ParseTokenOutput {
136 return { kind, start, end, value: JSON.parse(string.slice(start, end)) };

Callers 2

parseMemberFunction · 0.85
parseArrFunction · 0.85

Calls 5

parseArrFunction · 0.85
parseObjFunction · 0.85
curTokenFunction · 0.85
expectFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…