MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readJson

Function readJson

apps/cli/src/device-login.ts:178–186  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

176 });
177
178const readJson = async (response: Response): Promise<Record<string, unknown>> => {
179 const text = await response.text();
180 if (!text) return {};
181 try {
182 return JSON.parse(text) as Record<string, unknown>;
183 } catch {
184 return { error: "invalid_response", error_description: text.slice(0, 200) };
185 }
186};
187
188export const discoverCliLogin = async (
189 origin: string,

Callers 4

discoverCliLoginFunction · 0.85
requestDeviceCodeFunction · 0.85
pollForDeviceTokensFunction · 0.85
refreshDeviceTokensFunction · 0.85

Calls 1

textMethod · 0.65

Tested by

no test coverage detected