Comparing version 2.1.1 to 2.1.2
@@ -0,1 +1,4 @@ | ||
# v2.1.2 | ||
- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs (#1293). | ||
# v2.1.0 | ||
@@ -2,0 +5,0 @@ |
'use strict'; | ||
import noop from 'lodash-es/noop'; | ||
import breakLoop from './breakLoop'; | ||
export default function _createTester(eachfn, check, getResult) { | ||
return function(arr, limit, iteratee, cb) { | ||
function done(err) { | ||
function done() { | ||
if (cb) { | ||
if (err) { | ||
cb(err); | ||
} else { | ||
cb(null, getResult(false)); | ||
} | ||
cb(null, getResult(false)); | ||
} | ||
@@ -18,12 +15,12 @@ } | ||
iteratee(x, function (err, v) { | ||
if (cb) { | ||
if (err) { | ||
cb(err); | ||
cb = iteratee = false; | ||
} else if (check(v)) { | ||
cb(null, getResult(true, x)); | ||
cb = iteratee = false; | ||
} | ||
// Check cb as another iteratee may have resolved with a | ||
// value or error since we started this iteratee | ||
if (cb && (err || check(v))) { | ||
if (err) cb(err); | ||
else cb(err, getResult(true, x)); | ||
cb = iteratee = false; | ||
callback(err, breakLoop); | ||
} else { | ||
callback(); | ||
} | ||
callback(); | ||
}); | ||
@@ -30,0 +27,0 @@ } |
@@ -7,2 +7,4 @@ import noop from 'lodash-es/noop'; | ||
import breakLoop from './breakLoop'; | ||
export default function _eachOfLimit(limit) { | ||
@@ -18,3 +20,3 @@ return function (obj, iteratee, callback) { | ||
function iterateeCallback(err) { | ||
function iterateeCallback(err, value) { | ||
running -= 1; | ||
@@ -25,3 +27,4 @@ if (err) { | ||
} | ||
else if (done && running <= 0) { | ||
else if (value === breakLoop || (done && running <= 0)) { | ||
done = true; | ||
return callback(null); | ||
@@ -28,0 +31,0 @@ } |
@@ -29,4 +29,5 @@ import mapValuesLimit from './mapValuesLimit'; | ||
* @param {Function} [callback] - A callback which is called when all `iteratee` | ||
* functions have finished, or an error occurs. Results is an array of the | ||
* transformed items from the `obj`. Invoked with (err, result). | ||
* functions have finished, or an error occurs. `result` is a new object consisting | ||
* of each key from `obj`, with each transformed value on the right-hand side. | ||
* Invoked with (err, result). | ||
* @example | ||
@@ -41,3 +42,3 @@ * | ||
* }, function(err, result) { | ||
* // results is now a map of stats for each file, e.g. | ||
* // result is now a map of stats for each file, e.g. | ||
* // { | ||
@@ -44,0 +45,0 @@ * // f1: [stats for file1], |
@@ -23,4 +23,5 @@ import eachOfLimit from './eachOfLimit'; | ||
* @param {Function} [callback] - A callback which is called when all `iteratee` | ||
* functions have finished, or an error occurs. Result is an object of the | ||
* transformed values from the `obj`. Invoked with (err, result). | ||
* functions have finished, or an error occurs. `result` is a new object consisting | ||
* of each key from `obj`, with each transformed value on the right-hand side. | ||
* Invoked with (err, result). | ||
*/ | ||
@@ -27,0 +28,0 @@ export default function mapValuesLimit(obj, limit, iteratee, callback) { |
@@ -19,5 +19,6 @@ import mapValuesLimit from './mapValuesLimit'; | ||
* @param {Function} [callback] - A callback which is called when all `iteratee` | ||
* functions have finished, or an error occurs. Result is an object of the | ||
* transformed values from the `obj`. Invoked with (err, result). | ||
* functions have finished, or an error occurs. `result` is a new object consisting | ||
* of each key from `obj`, with each transformed value on the right-hand side. | ||
* Invoked with (err, result). | ||
*/ | ||
export default doLimit(mapValuesLimit, 1); |
{ | ||
"name": "async-es", | ||
"description": "Higher-order functions and common patterns for asynchronous code", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"main": "index.js", | ||
@@ -24,5 +24,6 @@ "author": "Caolan McMahon", | ||
"devDependencies": { | ||
"babel-cli": "^6.16.0", | ||
"babel-core": "^6.3.26", | ||
"babel-plugin-add-module-exports": "~0.1.2", | ||
"babel-plugin-istanbul": "^1.0.3", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-istanbul": "^2.0.1", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.3.16", | ||
@@ -32,17 +33,17 @@ "babel-preset-es2015": "^6.3.13", | ||
"benchmark": "^2.1.1", | ||
"bluebird": "^2.9.32", | ||
"bluebird": "^3.4.6", | ||
"chai": "^3.1.0", | ||
"cheerio": "^0.20.0", | ||
"cheerio": "^0.22.0", | ||
"coveralls": "^2.11.2", | ||
"es6-promise": "^2.3.0", | ||
"eslint": "^2.11.1", | ||
"eslint": "^2.13.1", | ||
"fs-extra": "^0.26.7", | ||
"gh-pages-deploy": "^0.4.2", | ||
"jsdoc": "^3.4.0", | ||
"karma": "^0.13.2", | ||
"karma-browserify": "^4.2.1", | ||
"karma-firefox-launcher": "^0.1.6", | ||
"karma-mocha": "^0.2.0", | ||
"karma-mocha-reporter": "^1.0.2", | ||
"mocha": "^2.2.5", | ||
"karma": "^1.3.0", | ||
"karma-browserify": "^5.1.0", | ||
"karma-firefox-launcher": "^1.0.0", | ||
"karma-mocha": "^1.2.0", | ||
"karma-mocha-reporter": "^2.2.0", | ||
"mocha": "^3.1.2", | ||
"native-promise-only": "^0.8.0-a", | ||
@@ -52,10 +53,11 @@ "nyc": "^7.0.0", | ||
"rimraf": "^2.5.0", | ||
"rollup": "^0.25.0", | ||
"rollup-plugin-node-resolve": "^1.5.0", | ||
"rollup-plugin-npm": "~1.3.0", | ||
"rollup": "^0.36.3", | ||
"rollup-plugin-node-resolve": "^2.0.0", | ||
"rollup-plugin-npm": "^2.0.0", | ||
"rsvp": "^3.0.18", | ||
"semver": "^4.3.6", | ||
"uglify-js": "~2.4.0", | ||
"uglify-js": "~2.7.3", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0", | ||
"watchify": "^3.7.0", | ||
"yargs": "~3.9.1" | ||
@@ -71,3 +73,3 @@ }, | ||
"mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", | ||
"test": "npm run-script lint && npm run mocha-node-test" | ||
"test": "npm run lint && npm run mocha-node-test" | ||
}, | ||
@@ -74,0 +76,0 @@ "license": "MIT", |
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
173113
102
4125
37