This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/graphql-types/node_modules/graphql-upload/private/ignoreStream.js

17 lines
364 B
JavaScript

'use strict';
/**
* Safely ignores a Node.js readable stream.
* @kind function
* @name ignoreStream
* @param {ReadableStream} stream Node.js readable stream.
* @ignore
*/
module.exports = function ignoreStream(stream) {
// Prevent an unhandled error from crashing the process.
stream.on('error', () => {});
// Waste the stream.
stream.resume();
};