You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
323 B
JavaScript
12 lines
323 B
JavaScript
"use strict";
|
|
|
|
const warn = require("./warn");
|
|
|
|
module.exports = function destroyStream(stream) {
|
|
if (typeof stream.destroy === "function") {
|
|
stream.destroy();
|
|
} else {
|
|
warn("The stream you are converting does not have a 'destroy' method, and could therefore not be destroyed. This may cause resource leaks!");
|
|
}
|
|
};
|