Comparing version 2.0.1 to 2.1.0
@@ -0,0 +0,0 @@ # How to contribute |
@@ -36,3 +36,3 @@ 'use strict'; | ||
method(array[i], done); | ||
method(array[i], done, i); | ||
}; | ||
@@ -71,3 +71,3 @@ | ||
for (let i = 0; i < array.length; ++i) { | ||
method(array[i], done); | ||
method(array[i], done, i); | ||
} | ||
@@ -74,0 +74,0 @@ } |
{ | ||
"name": "items", | ||
"description": "Bare minimum async methods", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"repository": "git://github.com/hapijs/items", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -0,0 +0,0 @@ #items |
@@ -30,6 +30,8 @@ 'use strict'; | ||
const called = []; | ||
const is = []; | ||
const array = [1, 2, 3, 4, 5]; | ||
const method = function (item, next) { | ||
const method = function (item, next, i) { | ||
called.push(item); | ||
is.push(i); | ||
setTimeout(next, 5); | ||
@@ -42,2 +44,3 @@ }; | ||
expect(called).to.deep.equal(array); | ||
expect(is).to.deep.equal([0, 1, 2, 3, 4]); | ||
done(); | ||
@@ -94,4 +97,6 @@ }); | ||
const array = [[1, 1], [2, 4], [3, 2], [4, 3], [5, 5]]; | ||
const method = function (item, next) { | ||
const is = []; | ||
const method = function (item, next, i) { | ||
is.push(i); | ||
setTimeout(() => { | ||
@@ -108,2 +113,3 @@ | ||
expect(called).to.deep.equal([1, 3, 4, 2, 5]); | ||
expect(is).to.deep.equal([0, 1, 2, 3, 4]); | ||
done(); | ||
@@ -110,0 +116,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
303
16347