array-tools
Advanced tools
Comparing version 1.8.2 to 1.8.3
{ | ||
"name": "array-tools", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.8.2", | ||
"version": "1.8.3", | ||
"description": "Lightweight tool-kit for working with arrays", | ||
@@ -38,5 +38,5 @@ "repository": "https://github.com/75lb/array-tools.git", | ||
"dependencies": { | ||
"object-tools": "^1.1.0", | ||
"object-tools": "^1.6.1", | ||
"typical": "^2.1" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
var test = require("tape"), | ||
a = require("../"); | ||
var test = require("tape"); | ||
var a = require("../"); | ||
@@ -15,1 +15,13 @@ test("findWhere", function(t){ | ||
}); | ||
test(".findWhere deep query", function(t){ | ||
var arr = [ | ||
{ one: { number: 1, letter: "a" } }, | ||
{ one: { number: 2, letter: "b" } } | ||
]; | ||
t.deepEqual(a.findWhere(arr, { one: { number: 1 } }), { one: { number: 1, letter: "a" } }); | ||
t.deepEqual(a.findWhere(arr, { one: { number: 2 } }), { one: { number: 2, letter: "b" } }); | ||
t.deepEqual(a.findWhere(arr, { one: { letter: "b" } }), { one: { number: 2, letter: "b" } }); | ||
t.deepEqual(a.findWhere(arr, { one: { number: 3 } }), null); | ||
t.end(); | ||
}); |
@@ -1,3 +0,3 @@ | ||
var test = require("tape"), | ||
a = require("../"); | ||
var test = require("tape"); | ||
var a = require("../"); | ||
@@ -44,1 +44,20 @@ test("where", function(t){ | ||
}); | ||
test(".where deep query", function(t){ | ||
var arr = [ | ||
{ one: { number: 1, letter: "a" } }, | ||
{ one: { number: 2, letter: "b" } }, | ||
{ one: { number: 3, letter: "b" } } | ||
]; | ||
t.deepEqual(a.where(arr, { one: { letter: "b" } }), [ | ||
{ one: { number: 2, letter: "b" } }, | ||
{ one: { number: 3, letter: "b" } } | ||
]); | ||
t.deepEqual(a.where(arr, { one: { number: 2, letter: "b" } }), [ | ||
{ one: { number: 2, letter: "b" } } | ||
]); | ||
t.deepEqual(a.where(arr, { one: { number: 1, letter: "a" } }), [ | ||
{ one: { number: 1, letter: "a" } } | ||
]); | ||
t.end(); | ||
}); |
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
53779
1206
Updatedobject-tools@^1.6.1