apr-engine-iterator
Advanced tools
Comparing version 1.0.1 to 1.0.2
36
index.js
@@ -8,6 +8,6 @@ const buildArray = require('build-array'); | ||
const wrap = (fn) => { | ||
const wrap = fn => { | ||
let i = 0; | ||
const group = (size) => { | ||
const group = size => { | ||
if (isFinite(size)) { | ||
@@ -17,8 +17,6 @@ return buildArray(size).map(next); | ||
return until(() => { | ||
return next(); | ||
}); | ||
return until(() => next()); | ||
}; | ||
const next = (size) => { | ||
const next = size => { | ||
if (size) { | ||
@@ -36,14 +34,11 @@ return group(size); | ||
const arr = (input) => { | ||
return wrap((i) => { | ||
return { | ||
value: input[i], | ||
done: input.length === i, | ||
key: i | ||
}; | ||
}); | ||
}; | ||
const arr = input => | ||
wrap(i => ({ | ||
value: input[i], | ||
done: input.length === i, | ||
key: i | ||
})); | ||
const ittr = (input) => { | ||
return wrap((i) => { | ||
const ittr = input => | ||
wrap(i => { | ||
const item = input.next(); | ||
@@ -57,8 +52,7 @@ | ||
}); | ||
}; | ||
const obj = (input) => { | ||
const obj = input => { | ||
const okeys = keys(input); | ||
return wrap((i) => { | ||
return wrap(i => { | ||
const key = okeys[i]; | ||
@@ -74,3 +68,3 @@ | ||
module.exports = (input) => { | ||
module.exports = input => { | ||
if (isArray(input)) { | ||
@@ -77,0 +71,0 @@ return arr(input); |
{ | ||
"name": "apr-engine-iterator", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/ramitos/apr/tree/master/packages/engine-iterator", | ||
@@ -11,3 +11,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"apr-engine-until": "^1.0.1", | ||
"apr-engine-until": "^1.0.2", | ||
"build-array": "^1.0.0", | ||
@@ -14,0 +14,0 @@ "lodash.isarraylike": "^4.2.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
1665
58
Updatedapr-engine-until@^1.0.2