find-replace
Advanced tools
Comparing version 0.2.0 to 0.2.1
"use strict"; | ||
var t = require("typical"); | ||
var arrayify = require("array-back"); | ||
var testValue = require("test-value"); | ||
@@ -23,21 +24,2 @@ /** | ||
function testValue(value, test){ | ||
if (t.isPlainObject(test)){ | ||
return Object.keys(test).every(function(prop){ | ||
return testValue(value[prop], test[prop]); | ||
}); | ||
} else if (Array.isArray(test)){ | ||
var tests = test; | ||
return tests.some(function(test){ | ||
return testValue(value, test); | ||
}); | ||
} else if (test instanceof RegExp){ | ||
return test.test(value); | ||
} else if (typeof test === "function"){ | ||
return test(value); | ||
} else { | ||
return test === value; | ||
} | ||
} | ||
/** | ||
@@ -44,0 +26,0 @@ @param {array} - the input array |
{ | ||
"name": "find-replace", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Find and replace items of an array", | ||
@@ -27,4 +27,5 @@ "repository": "https://github.com/75lb/find-replace.git", | ||
"array-back": "^1.0.1", | ||
"test-value": "^1.0.0", | ||
"typical": "^2.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
6996
3
97
+ Addedtest-value@^1.0.0
+ Addedtest-value@1.1.0(transitive)