@supercharge/collections
Advanced tools
Comparing version 1.12.1 to 1.12.2
# Changelog | ||
## [1.12.2](https://github.com/supercharge/collections/compare/v1.12.1...v1.12.2) - 2020-03-12 | ||
### Fixed | ||
- `findSeries` now stops when the first matching item is found | ||
## [1.12.1](https://github.com/supercharge/collections/compare/v1.12.0...v1.12.1) - 2020-03-12 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@supercharge/collections", | ||
"description": "Supercharge collections", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"author": "Marcus PΓΆhls <marcus@futurestud.io>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -176,5 +176,9 @@ 'use strict' | ||
async findSeries (callback) { | ||
const mapped = await this.mapSeries(callback) | ||
for (const index in this.items) { | ||
const result = await callback(this.items[index], index, this.items) | ||
return this.items.find((_, i) => mapped[i]) | ||
if (result) { | ||
return this.items[index] | ||
} | ||
} | ||
} | ||
@@ -195,3 +199,3 @@ | ||
if (typeof callback === 'function') { | ||
return this.find(callback) | ||
return this.findSeries(callback) | ||
} | ||
@@ -198,0 +202,0 @@ |
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
44963
1333