MCPcopy Create free account
hub / github.com/denoland/std / parse

Method parse

jsonc/parse.ts:72–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 this.#tokenized = this.#tokenize();
71 }
72 parse(): JsonValue {
73 const token = this.#getNext();
74 const res = this.#parseJsonValue(token);
75
76 // make sure all characters have been read
77 const { done, value } = this.#tokenized.next();
78 if (!done) {
79 throw new SyntaxError(buildErrorMessage(value));
80 }
81
82 return res;
83 }
84 /** Read the next token. If the token is read to the end, it throws a SyntaxError. */
85 #getNext(): Token {
86 const { done, value } = this.#tokenized.next();

Callers 15

fnFunction · 0.45
parseFunction · 0.45
#parseStringMethod · 0.45
15.12.1.1-g2-2.jsFile · 0.45
15.12.1.1-g5-1.jsFile · 0.45
text-object.jsFile · 0.45
15.12.2-2-4.jsFile · 0.45
15.12.1.1-0-5.jsFile · 0.45
15.12.1.1-g5-2.jsFile · 0.45

Calls 4

#getNextMethod · 0.95
#parseJsonValueMethod · 0.95
buildErrorMessageFunction · 0.85
nextMethod · 0.45

Tested by

no test coverage detected