diff --git a/.release-it.json b/.release-it.json index d7341a3..a9849f9 100644 --- a/.release-it.json +++ b/.release-it.json @@ -12,6 +12,7 @@ ] }, "github": { - "release": true + "release": true, + "proxy": "http://127.0.0.1:9090" } } diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..cf33f42 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,3 @@ +interface NxStatic { + promiseSeries: (tasks: Promise[], initial: any) => Promise; +} diff --git a/package.json b/package.json index ec7aa22..6af563d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "gulp-uglify": "^3.0.2", "jest": "^26.6.3", "prettier": "^2.2.1", - "release-it": "^14.2.2", + "release-it": "^15.5.0", "uglify-js": "3.12.4", "uglify-save-license": "^0.4.1" }, @@ -45,4 +45,4 @@ "promise", "series" ] -} \ No newline at end of file +} diff --git a/src/index.js b/src/index.js index 3c12167..9155264 100644 --- a/src/index.js +++ b/src/index.js @@ -4,12 +4,12 @@ var MSG_ERR = 'promise.series only accepts an array of functions'; var NUM = 'number'; - nx.promiseSeries = function(inTasks, inInitial) { + nx.promiseSeries = function (inTasks, inInitial) { if (!typeof inTasks.length === NUM) { return Promise.reject(new TypeError(MSG_ERR)); } - return inTasks.reduce(function(current, next) { - return current.then(next); + return inTasks.reduce(function (res, next) { + return res.then(next); }, Promise.resolve(inInitial)); };