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

Method cancel

lib/internal/webstreams/readablestream.js:347–355  ·  view source on GitHub ↗

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

(reason = undefined)

Source from the content-addressed store, hash-verified

345 * @returns { Promise<void> }
346 */
347 cancel(reason = undefined) {
348 if (!isReadableStream(this))
349 return PromiseReject(new ERR_INVALID_THIS('ReadableStream'));
350 if (isReadableStreamLocked(this)) {
351 return PromiseReject(
352 new ERR_INVALID_STATE.TypeError('ReadableStream is locked'));
353 }
354 return readableStreamCancel(this, reason);
355 }
356
357 /**
358 * @param {{

Callers 3

destroyFunction · 0.45
closeReaderFunction · 0.45

Calls 3

isReadableStreamLockedFunction · 0.85
readableStreamCancelFunction · 0.85
isReadableStreamFunction · 0.50

Tested by

no test coverage detected