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

Method expectChar

src/common/json5.ts:299–306  ·  view source on GitHub ↗
(expected: string)

Source from the content-addressed store, hash-verified

297 }
298
299 private expectChar(expected: string): void {
300 if (this.currentChar() !== expected) {
301 throw this.error(
302 `Expected '${expected}' but found '${this.currentChar()}'`
303 );
304 }
305 this.index++;
306 }
307
308 currentChar(): string {
309 return this.text[this.index];

Callers 2

parseObjectMethod · 0.95
parseArrayMethod · 0.95

Calls 2

currentCharMethod · 0.95
errorMethod · 0.95

Tested by

no test coverage detected