MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / json

Method json

tests/mocks/request.ts:112–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 }
111
112 async json(): Promise<any> {
113 if (this.bodyUsed) throw new TypeError("Body already consumed");
114 (this as any).bodyUsed = true;
115 if (!this.#bytes) return null;
116 const text = new TextDecoder().decode(this.#bytes);
117 try {
118 return JSON.parse(text);
119 } catch {
120 throw new SyntaxError("Invalid JSON");
121 }
122 }
123
124 async text(): Promise<string> {
125 if (this.bodyUsed) throw new TypeError("Body already consumed");

Callers 13

GetNetDiskTokenFunction · 0.45
RefreshTokenFunction · 0.45
requestMethod · 0.45
requestMethod · 0.45
requestMethod · 0.45
requestMethod · 0.45
formatUrlFunction · 0.45
handleTestConnectionFunction · 0.45
handleFetchModelsFunction · 0.45
AppFunction · 0.45
sendRequestMethod · 0.45

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected