MCPcopy Index your code
hub / github.com/nodejs/node / clone

Method clone

deps/undici/undici.js:12129–12142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12127 }
12128 // Returns a clone of response.
12129 clone() {
12130 webidl.brandCheck(this, _Response);
12131 if (bodyUnusable(this.#state)) {
12132 throw webidl.errors.exception({
12133 header: "Response.clone",
12134 message: "Body has already been consumed."
12135 });
12136 }
12137 const clonedResponse = cloneResponse(this.#state);
12138 if (this.#state.urlList.length !== 0 && this.#state.body?.stream) {
12139 streamRegistry.register(this, new WeakRef(this.#state.body.stream));
12140 }
12141 return fromInnerResponse(clonedResponse, getHeadersGuard(this.#headers));
12142 }
12143 [nodeUtil.inspect.custom](depth, options) {
12144 if (options.depth === null) {
12145 options.depth = 2;

Callers

nothing calls this directly

Calls 6

brandCheckMethod · 0.80
exceptionMethod · 0.80
bodyUnusableFunction · 0.70
cloneResponseFunction · 0.70
fromInnerResponseFunction · 0.70
registerMethod · 0.45

Tested by

no test coverage detected