Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
func.push(initPrivateTmpDir(value));
break;
default:
func.push(
writeStdout(hostMsg(`No handler found for ${key}.`, "warn")),
);
}
}
} else {
func.push(writeStdout(hostMsg(`No handler found for ${msg}.`, "warn")));
}
return Promise.all(func);
};
/* input */
const input = new Input();
/**
* read stdin
* @param {string|Buffer} chunk - chunk
* @returns {?AsyncFunction} - Promise chain
*/
const readStdin = chunk => {
const func = [];
const arr = input.decode(chunk);
if (Array.isArray(arr) && arr.length) {
for (const msg of arr) {
msg && func.push(handleMsg(msg));
}
}
return func.length && Promise.all(func).catch(handleReject) || null;
};