« get me outta code hell

let progressPromiseAll take non-promise fns - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-06-01 14:56:13 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-06-01 14:56:13 -0300
commit76207fff8bd19d443242ceb841aba09d2fc24190 (patch)
tree7480c63e20617227e6d44d131cb7da89ba9b8249 /src/util
parent5706477b7132f7ae2ec72000542a81d6ef2c0c51 (diff)
let progressPromiseAll take non-promise fns
Diffstat (limited to 'src/util')
-rw-r--r--src/util/cli.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/cli.js b/src/util/cli.js
index 77711566..7f84be7c 100644
--- a/src/util/cli.js
+++ b/src/util/cli.js
@@ -195,7 +195,7 @@ export function progressPromiseAll(msgOrMsgFn, array) {
     let done = 0, total = array.length;
     process.stdout.write(`\r${msgFn()} [0/${total}]`);
     const start = Date.now();
-    return Promise.all(array.map(promise => promise.then(val => {
+    return Promise.all(array.map(promise => Promise.resolve(promise).then(val => {
         done++;
         // const pc = `${done}/${total}`;
         const pc = (Math.round(done / total * 1000) / 10 + '%').padEnd('99.9%'.length, ' ');