From 953ddd82e48dd206cef5ac94456549aed13b3ad5 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 17 Nov 2023 23:25:29 +0100 Subject: Updated 30 files and deleted 2976 files (automated) --- .../source/utils/delay-async-destroy.js | 33 ---------------------- 1 file changed, 33 deletions(-) delete mode 100644 includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js (limited to 'includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js') diff --git a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js b/includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js deleted file mode 100644 index 53d81cf..0000000 --- a/includes/external/addressbook/node_modules/http2-wrapper/source/utils/delay-async-destroy.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -module.exports = stream => { - if (stream.listenerCount('error') !== 0) { - return stream; - } - - stream.__destroy = stream._destroy; - stream._destroy = (...args) => { - const callback = args.pop(); - - stream.__destroy(...args, async error => { - await Promise.resolve(); - callback(error); - }); - }; - - const onError = error => { - // eslint-disable-next-line promise/prefer-await-to-then - Promise.resolve().then(() => { - stream.emit('error', error); - }); - }; - - stream.once('error', onError); - - // eslint-disable-next-line promise/prefer-await-to-then - Promise.resolve().then(() => { - stream.off('error', onError); - }); - - return stream; -}; -- cgit