From 6099c4b921a0ce36f07c25e74310f103f9277e97 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 25 Apr 2022 23:24:03 +1000 Subject: [PATCH] fix: don't return promise in async function --- lib/encoder.js | 2 +- lib/iterator-channel.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/encoder.js b/lib/encoder.js index 38e67bf..e22c5fe 100644 --- a/lib/encoder.js +++ b/lib/encoder.js @@ -59,7 +59,7 @@ function createEncoder (writer) { * @returns {Promise} */ async close () { - return writer.end() + await writer.end() /* c8 ignore next 2 */ // Node.js 12 c8 bug } diff --git a/lib/iterator-channel.js b/lib/iterator-channel.js index 16e7588..1b934a1 100644 --- a/lib/iterator-channel.js +++ b/lib/iterator-channel.js @@ -52,7 +52,7 @@ export function create () { ended = true const drainer = makeDrainer() outWaitResolver() - return drainer + await drainer /* c8 ignore next 2 */ // Node.js 12 c8 bug }