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

Method cancel

lib/internal/webstreams/readablestream.js:1106–1114  ·  view source on GitHub ↗

* @param {any} [reason] * @returns {Promise }

(reason = undefined)

Source from the content-addressed store, hash-verified

1104 * @returns {Promise<void>}
1105 */
1106 cancel(reason = undefined) {
1107 if (!isReadableStreamBYOBReader(this))
1108 return PromiseReject(new ERR_INVALID_THIS('ReadableStreamBYOBReader'));
1109 if (this[kState].stream === undefined) {
1110 return PromiseReject(new ERR_INVALID_STATE.TypeError(
1111 'The reader is not attached to a stream'));
1112 }
1113 return readableStreamReaderGenericCancel(this, reason);
1114 }
1115
1116 [kInspect](depth, options) {
1117 return customInspect(depth, options, this[kType], {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected