MCPcopy Create free account
hub / github.com/angular/dev-infra / destroy

Function destroy

github-actions/browserstack/set-browserstack-env.js:1336–1353  ·  view source on GitHub ↗
(stream2, err)

Source from the content-addressed store, hash-verified

1334 return body && !!(body.destroyed || body[kDestroyed] || ((_a = stream.isDestroyed) == null ? void 0 : _a.call(stream, body)));
1335 }
1336 function destroy(stream2, err) {
1337 if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) {
1338 return;
1339 }
1340 if (typeof stream2.destroy === "function") {
1341 if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) {
1342 stream2.socket = null;
1343 }
1344 stream2.destroy(err);
1345 } else if (err) {
1346 queueMicrotask(() => {
1347 stream2.emit("error", err);
1348 });
1349 }
1350 if (stream2.destroyed !== true) {
1351 stream2[kDestroyed] = true;
1352 }
1353 }
1354 var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
1355 function parseKeepAliveTimeout(val) {
1356 const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);

Callers 1

constructorMethod · 0.70

Calls 4

isStreamFunction · 0.70
isDestroyedFunction · 0.70
destroyMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected