Comparing version 0.2.0 to 0.3.0
@@ -19,3 +19,4 @@ const scripts = (x) => ({ scripts: x }); | ||
publish: `nps build && cd ${OUT_DIR} && npm publish`, | ||
watch: 'onchange "./src/**/*.{js,jsx,ts}" -i -- nps private.watch', | ||
watch: | ||
'onchange "./src/**/*.{js,jsx,ts}" --initial --kill -- nps private.watch', | ||
fix: `prettier --write "./**/*.{js,jsx,ts,json,scss}"`, | ||
@@ -32,3 +33,3 @@ lint: { | ||
watch: | ||
'onchange "./{test,src}/**/*.{js,jsx,ts}" -i -- nps private.test_watch' | ||
'onchange "./{test,src}/**/*.{js,jsx,ts}" --initial --kill -- nps private.test_watch' | ||
}, | ||
@@ -35,0 +36,0 @@ validate: |
{ | ||
"name": "promist", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"author": "Rafa Mel", | ||
@@ -50,10 +50,10 @@ "description": "A dependable Promises and async utility belt", | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-decorators": "^7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.2.3", | ||
"@babel/plugin-proposal-decorators": "^7.2.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/preset-env": "^7.2.3", | ||
"@babel/register": "^7.0.0", | ||
"@types/jest": "^23.3.9", | ||
"@types/jest": "^23.3.11", | ||
"babel-core": "^7.0.0-bridge.0", | ||
@@ -65,3 +65,3 @@ "babel-eslint": "^10.0.1", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^5.10.0", | ||
"eslint": "^5.11.1", | ||
"eslint-config-prettier": "^3.3.0", | ||
@@ -74,7 +74,7 @@ "eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-node": "^8.0.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"eslint-plugin-promise": "^4.0.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"eslint-restricted-globals": "^0.2.0", | ||
"husky": "^1.2.1", | ||
"husky": "^1.3.1", | ||
"jake": "^8.0.19", | ||
@@ -81,0 +81,0 @@ "jest-cli": "^23.6.0", |
@@ -12,2 +12,6 @@ "use strict"; | ||
var _deferred = _interopRequireDefault(require("./create/deferred")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function map(arr, fn) { | ||
@@ -37,8 +41,10 @@ return Promise.all(arr).then(function (resArr) { | ||
return resArr.slice(1).reduce(function (acc, x, i) { | ||
return acc.then(function (val) { | ||
return cb(val, x, i + 1, resArr); | ||
var p = (0, _deferred.default)(); | ||
acc.then(function (val) { | ||
return p.resolve(val); | ||
}).catch(function (err) { | ||
return p.reject(err); | ||
}); | ||
}, initialValue === undefined ? Promise.resolve(resArr[0]) : Promise.resolve(initialValue).then(function (val) { | ||
return cb(val, resArr[0], 0, resArr); | ||
})); | ||
return cb(p, x, i + 1, resArr); | ||
}, initialValue === undefined ? Promise.resolve(resArr[0]) : Promise.resolve(cb(Promise.resolve(initialValue), resArr[0], 0, resArr))); | ||
}); | ||
@@ -45,0 +51,0 @@ } |
@@ -263,5 +263,11 @@ # Promist | ||
* *Series* collection functions execute serially. The passed functions (callbacks) receive an array of promises. | ||
* *Parallel* collection functions execute in parallel in two stages: first, the resolution of all promises, then the passed function calls (`parallel.reduce()` executes this serially). The passed functions (callbacks) receive an array with the values the input array of promises resolved to. | ||
* *Series:* | ||
* Collection functions execute serially. | ||
* The passed functions (callbacks) receive an array of promises. | ||
* *Parallel:* | ||
* Collection functions execute in parallel in two stages: first, the resolution of all promises, then the passed function calls. | ||
* The passed functions (callbacks) receive an array with the values the input array of promises resolved to. | ||
* `parallel.reduce()` receives a promise as the accumulator parameter. | ||
```javascript | ||
@@ -268,0 +274,0 @@ import { parallel } from 'promist'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42506
856
306