Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/p-try/index.js')
-rw-r--r--node_modules/p-try/index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/node_modules/p-try/index.js b/node_modules/p-try/index.js
index efa2f7433..db858da29 100644
--- a/node_modules/p-try/index.js
+++ b/node_modules/p-try/index.js
@@ -1,4 +1,9 @@
'use strict';
-module.exports = cb => new Promise(resolve => {
- resolve(cb());
+
+const pTry = (fn, ...arguments_) => new Promise(resolve => {
+ resolve(fn(...arguments_));
});
+
+module.exports = pTry;
+// TODO: remove this in the next major version
+module.exports.default = pTry;