MCPcopy
hub / github.com/di-sukharev/opencommit / constructor

Method constructor

out/cli.cjs:6703–6722  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6701 var STATUS_CODES = http4.STATUS_CODES;
6702 var Response6 = class _Response {
6703 constructor() {
6704 let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
6705 let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6706 Body.call(this, body, opts);
6707 const status = opts.status || 200;
6708 const headers = new Headers6(opts.headers);
6709 if (body != null && !headers.has("Content-Type")) {
6710 const contentType = extractContentType(body);
6711 if (contentType) {
6712 headers.append("Content-Type", contentType);
6713 }
6714 }
6715 this[INTERNALS$1] = {
6716 url: opts.url,
6717 status,
6718 statusText: opts.statusText || STATUS_CODES[status],
6719 headers,
6720 counter: opts.counter
6721 };
6722 }
6723 get url() {
6724 return this[INTERNALS$1].url || "";
6725 }

Callers

nothing calls this directly

Calls 6

extractContentTypeFunction · 0.85
makeResponseFunction · 0.85
extractBodyFunction · 0.85
initializeResponseFunction · 0.85
hasMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected