MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / defaultParseResponse

Function defaultParseResponse

out/cli.cjs:69496–69521  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

69494 return kind3 === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state2.set(receiver, value), value;
69495};
69496var __classPrivateFieldGet6 = function(receiver, state2, kind3, f4) {
69497 if (kind3 === "a" && !f4) throw new TypeError("Private accessor was defined without a getter");
69498 if (typeof state2 === "function" ? receiver !== state2 || !f4 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
69499 return kind3 === "m" ? f4 : kind3 === "a" ? f4.call(receiver) : f4 ? f4.value : state2.get(receiver);
69500};
69501var _AbstractPage_client;
69502async function defaultParseResponse(props) {
69503 const { response } = props;
69504 if (props.options.stream) {
69505 debug("response", response.status, response.url, response.headers, response.body);
69506 if (props.options.__streamClass) {
69507 return props.options.__streamClass.fromSSEResponse(response, props.controller);
69508 }
69509 return Stream.fromSSEResponse(response, props.controller);
69510 }
69511 if (response.status === 204) {
69512 return null;
69513 }
69514 if (props.options.__binaryResponse) {
69515 return response;
69516 }
69517 const contentType = response.headers.get("content-type");
69518 const isJSON = contentType?.includes("application/json") || contentType?.includes("application/vnd.api+json");
69519 if (isJSON) {
69520 const json = await response.json();
69521 debug("response", response.status, response.url, response.headers, json);
69522 return json;
69523 }
69524 const text = await response.text();

Callers 1

constructorMethod · 0.85

Calls 6

debugFunction · 0.85
fromSSEResponseMethod · 0.80
includesMethod · 0.80
getMethod · 0.45
jsonMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…