From c27003397aaa496b87b7647a9a47d61b479afb58 Mon Sep 17 00:00:00 2001 From: dedisuryadi Date: Sat, 19 Nov 2022 00:26:20 +0700 Subject: [PATCH] set errorProps default value to undefined Webstorm add a warning because not enough argument provided and this driving me crazy --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index cb4795f..6568ae3 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ * @param {Object} errorProps Object containing additional properties to include in a returned error * @return {Promise} Array with signature `[err, results]` */ -module.exports = function awaitHandler(promise, errorProps) { +module.exports = function awaitHandler(promise, errorProps = undefined) { return promise.then(data => { return [null, data]; }).catch(err => {