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

Function readJson

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

Source from the content-addressed store, hash-verified

141 });
142
143const readJson = async (response: Response): Promise<Record<string, unknown>> => {
144 const text = await response.text();
145 if (!text) return {};
146 try {
147 return JSON.parse(text) as Record<string, unknown>;
148 } catch {
149 return { error: "invalid_response", error_description: text.slice(0, 200) };
150 }
151};
152
153export const discoverCliLogin = async (origin: string): Promise<CliLoginDiscovery> => {
154 let response: Response;

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