Comparing version 2.0.5 to 2.0.6
{ | ||
"name": "sift", | ||
"description": "mongodb query style array filtering", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"repository": "crcn/sift.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -203,3 +203,3 @@ /* | ||
$regex: function(a, b) { | ||
return b && a.test(b); | ||
return typeof b === "string" && a.test(b); | ||
}, | ||
@@ -242,3 +242,3 @@ | ||
return function(b) { | ||
return a.test(comparable(b)); | ||
return typeof b === "string" && a.test(b); | ||
}; | ||
@@ -392,5 +392,3 @@ } else if (a instanceof Function) { | ||
var options = query.$options; | ||
delete query.$options; | ||
var validators = []; | ||
@@ -401,2 +399,4 @@ | ||
if (key === '$options') continue; | ||
if (operator[key]) { | ||
@@ -403,0 +403,0 @@ if (prepare[key]) a = key === '$regex' ? prepare[key](a, options): prepare[key](a); |
@@ -116,2 +116,4 @@ var assert = require("assert"); | ||
[{$regex:"a"},[undefined, null, true, false, 0, "aa"],["aa"]], | ||
[/a/,[undefined, null, true, false, 0, "aa"],["aa"]], | ||
[/.+/,[undefined, null, true, false, 0, "aa", {}],["aa"]], | ||
@@ -118,0 +120,0 @@ // $where |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
146977
1508