Socket
Socket
Sign inDemoInstall

sift

Package Overview
Dependencies
0
Maintainers
2
Versions
155
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 13.0.4 to 13.0.5

6

es/index.js

@@ -167,3 +167,7 @@ const typeChecker = (type) => {

if (a instanceof RegExp) {
return b => typeof b === "string" && a.test(b);
return b => {
const result = typeof b === "string" && a.test(b);
a.lastIndex = 0;
return result;
};
}

@@ -170,0 +174,0 @@ const comparableA = comparable(a);

@@ -208,3 +208,7 @@ /*! *****************************************************************************

if (a instanceof RegExp) {
return function (b) { return typeof b === "string" && a.test(b); };
return function (b) {
var result = typeof b === "string" && a.test(b);
a.lastIndex = 0;
return result;
};
}

@@ -211,0 +215,0 @@ var comparableA = comparable(a);

@@ -214,3 +214,7 @@ (function (global, factory) {

if (a instanceof RegExp) {
return function (b) { return typeof b === "string" && a.test(b); };
return function (b) {
var result = typeof b === "string" && a.test(b);
a.lastIndex = 0;
return result;
};
}

@@ -217,0 +221,0 @@ var comparableA = comparable(a);

2

package.json
{
"name": "sift",
"description": "MongoDB query filtering in JavaScript",
"version": "13.0.4",
"version": "13.0.5",
"repository": "crcn/sift.js",

@@ -6,0 +6,0 @@ "sideEffects": false,

@@ -214,3 +214,7 @@ (function (global, factory) {

if (a instanceof RegExp) {
return function (b) { return typeof b === "string" && a.test(b); };
return function (b) {
var result = typeof b === "string" && a.test(b);
a.lastIndex = 0;
return result;
};
}

@@ -217,0 +221,0 @@ var comparableA = comparable(a);

@@ -15,3 +15,3 @@ !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).sift={})}(this,(function(n){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,i)};function i(n,i){function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var r=function(n){var t="[object "+n+"]";return function(n){return u(n)===t}},u=function(n){return Object.prototype.toString.call(n)},e=function(n){return n instanceof Date?n.getTime():o(n)?n.map(e):n&&"function"==typeof n.toJSON?n.toJSON():n},o=r("Array"),f=r("Object"),c=r("Function"),s=function(n,t){if(null==n&&n==t)return!0;if(n===t)return!0;if(Object.prototype.toString.call(n)!==Object.prototype.toString.call(t))return!1;if(o(n)){if(n.length!==t.length)return!1;for(var i=0,r=n.length;i<r;i++)if(!s(n[i],t[i]))return!1;return!0}if(f(n)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(var u in n)if(!s(n[u],t[u]))return!1;return!0}return!1},h=function(n,t,i,r,u,e){var f=t[r];if(o(n)&&isNaN(Number(f)))for(var c=0,s=n.length;c<s;c++)if(!h(n[c],t,i,r,c,n))return!1;return r===t.length||null==n?i(n,u,e):h(n[f],t,i,r+1,f,n)},a=function(){function n(n,t,i){this.params=n,this.owneryQuery=t,this.options=i,this.init()}return n.prototype.init=function(){},n.prototype.reset=function(){this.done=!1,this.success=!1},n}(),l=function(n){function t(t,i,r,u){var e=n.call(this,t,i,r)||this;return e.t=u,e}return i(t,n),t.prototype.reset=function(){this.success=!1,this.done=!1;for(var n=0,t=this.t.length;n<t;n++)this.t[n].reset()},t.prototype.childrenNext=function(n,t,i){for(var r=!0,u=!0,e=0,o=this.t.length;e<o;e++){var f=this.t[e];if(f.next(n,t,i),f.success||(u=!1),f.done){if(!f.success)break}else r=!1}this.done=r,this.success=u},t}(a),v=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(n,t,i){this.childrenNext(n,t,i)},t}(l),w=function(n){function t(t,i,r,u,e){var o=n.call(this,i,r,u,e)||this;return o.keyPath=t,o.i=function(n,t,i){return o.childrenNext(n,t,i),!o.done},o}return i(t,n),t.prototype.next=function(n,t,i){h(n,this.keyPath,this.i,0,t,i)},t}(l),p=function(n,t){if(n instanceof Function)return n;if(n instanceof RegExp)return function(t){return"string"==typeof t&&n.test(t)};var i=e(n);return function(n){return t(i,e(n))}},$=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.u=p(this.params,this.options.compare)},t.prototype.next=function(n,t,i){this.u(n,t,i)&&(this.done=!0,this.success=!0)},t}(a),b=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(){this.done=!0,this.success=!1},t}(a),d=function(n){return t=function(t,i,r){var u=typeof e(t),o=n(t);return new $((function(n){return typeof e(n)===u&&o(n)}),i,r)},function(n,i,r){return null==n?new b(n,i,r):t(n,i,r)};var t},j=function(n,t,i,r){var u=r.operations[n];if(!u)throw new Error("Unsupported operation: "+n);return u(t,i,r)},y=function(n){for(var t in n)if("$"===t.charAt(0))return!0;return!1},O=function(n,t,i,r){if(y(t)){var u=m(t,r),e=u[0];if(u[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new w(n,t,i,r,e)}return new w(n,t,i,r,[new $(t,i,r)])},_=function(n,t,i){var r=m(n,i),u=r[0],e=r[1],o=[];return u.length&&o.push(new w([],n,t,i,u)),o.push.apply(o,e),1===o.length?o[0]:new v(n,t,i,o)},m=function(n,t){var i,r=[],u=[];if(!(i=n)||i.constructor!==Object&&i.constructor!==Array&&"function Object() { [native code] }"!==i.constructor.toString()&&"function Array() { [native code] }"!==i.constructor.toString()||i.toJSON)return r.push(new $(n,n,t)),[r,u];for(var e in n)if("$"===e.charAt(0)){var o=j(e,n[e],n,t);null!=o&&r.push(o)}else u.push(O(e.split("."),n[e],n,t));return[r,u]},x=function(n,t){var i=void 0===t?{}:t,r=i.compare,u=i.operations,e=_(n,null,{compare:r||s,operations:Object.assign({},u||{})});return function(n,t,i){return e.reset(),e.next(n,t,i),e.success}},g=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.u=p(this.params,this.options.compare)},t.prototype.reset=function(){n.prototype.reset.call(this),this.success=!0},t.prototype.next=function(n){this.u(n)&&(this.done=!0,this.success=!1)},t}(a),E=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.o=_(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){this.o.reset()},t.prototype.next=function(n,t,i){this.o.reset(),o(i)?(this.o.next(n,t,i),this.done=this.o.done||t===i.length-1,this.success=this.o.success):(this.done=!0,this.success=!1)},t}(a),A=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.o=_(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){this.o.reset()},t.prototype.next=function(n,t,i){this.o.next(n,t,i),this.done=this.o.done,this.success=!this.o.success},t}(a),k=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){var n=this;this.s=this.params.map((function(t){return _(t,null,n.options)}))},t.prototype.reset=function(){this.done=!1,this.success=!1;for(var n=0,t=this.s.length;n<t;n++)this.s[n].reset()},t.prototype.next=function(n,t,i){for(var r=!1,u=!1,e=0,o=this.s.length;e<o;e++){var f=this.s[e];if(f.next(n,t,i),f.success){r=!0,u=f.success;break}}this.success=u,this.done=r},t}(a),F=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(t,i,r){n.prototype.next.call(this,t,i,r),this.success=!this.success},t}(k),N=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){var n=this;this.h=this.params.map((function(t){if(y(t))throw new Error("cannot nest $ under "+n.constructor.name.toLowerCase());return p(t,n.options.compare)}))},t.prototype.next=function(n,t,i){for(var r=!1,u=!1,e=0,o=this.h.length;e<o;e++){if((0,this.h[e])(n)){r=!0,u=!0;break}}this.success=u,this.done=r},t}(a),q=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(t,i,r){n.prototype.next.call(this,t,i,r),this.success=!this.success},t}(N),M=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(n,t,i){i.hasOwnProperty(t)===this.params&&(this.done=!0,this.success=!0)},t}(a),P=function(n){function t(t,i,r){return n.call(this,t,i,r,t.map((function(n){return _(n,i,r)})))||this}return i(t,n),t.prototype.next=function(n,t,i){this.childrenNext(n,t,i)},t}(l),R=function(n,t,i){return new $(n,t,i)},z=function(n,t,i){return new g(n,t,i)},C=function(n,t,i){return new k(n,t,i)},D=function(n,t,i){return new F(n,t,i)},I=function(n,t,i){return new E(n,t,i)},S=function(n,t,i){return new q(n,t,i)},U=function(n,t,i){return new N(n,t,i)},B=d((function(n){return function(t){return t<n}})),G=d((function(n){return function(t){return t<=n}})),H=d((function(n){return function(t){return t>n}})),J=d((function(n){return function(t){return t>=n}})),K=function(n,t,i){var r=n[0],u=n[1];return new $((function(n){return e(n)%r===u}),t,i)},L=function(n,t,i){return new M(n,t,i)},Q=function(n,t,i){return new $(new RegExp(n,t.$options),t,i)},T=function(n,t,i){return new A(n,t,i)},V=function(n,t,i){return new $((function(t){return null!=t&&(t instanceof n||t.constructor===n)}),t,i)},W=function(n,t,i){return new P(n,t,i)},X=W,Y=function(n,t,i){return new $((function(t){return t&&t.length===n}),t,i)},Z=function(){return null},nn=function(n,t,i){var r;if(c(n))r=n;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');r=new Function("obj","return "+n)}return new $((function(n){return r.bind(n)(n)}),t,i)},tn=Object.freeze({__proto__:null,$eq:R,$ne:z,$or:C,$nor:D,$elemMatch:I,$nin:S,$in:U,$lt:B,$lte:G,$gt:H,$gte:J,$mod:K,$exists:L,$regex:Q,$not:T,$type:V,$and:W,$all:X,$size:Y,$options:Z,$where:nn});n.$all=X,n.$and=W,n.$elemMatch=I,n.$eq=R,n.$exists=L,n.$gt=H,n.$gte=J,n.$in=U,n.$lt=B,n.$lte=G,n.$mod=K,n.$ne=z,n.$nin=S,n.$nor=D,n.$not=T,n.$options=Z,n.$or=C,n.$regex=Q,n.$size=Y,n.$type=V,n.$where=nn,n.EqualsOperation=$,n.createEqualsOperation=function(n,t,i){return new $(n,t,i)},n.createQueryTester=x,n.default=function(n,t){var i=void 0===t?{}:t,r=i.compare,u=i.operations;return x(n,{compare:r,operations:Object.assign({},tn,u)})},Object.defineProperty(n,"l",{value:!0})}));
***************************************************************************** */var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,i)};function i(n,i){function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var r=function(n){var t="[object "+n+"]";return function(n){return u(n)===t}},u=function(n){return Object.prototype.toString.call(n)},e=function(n){return n instanceof Date?n.getTime():o(n)?n.map(e):n&&"function"==typeof n.toJSON?n.toJSON():n},o=r("Array"),f=r("Object"),c=r("Function"),s=function(n,t){if(null==n&&n==t)return!0;if(n===t)return!0;if(Object.prototype.toString.call(n)!==Object.prototype.toString.call(t))return!1;if(o(n)){if(n.length!==t.length)return!1;for(var i=0,r=n.length;i<r;i++)if(!s(n[i],t[i]))return!1;return!0}if(f(n)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(var u in n)if(!s(n[u],t[u]))return!1;return!0}return!1},h=function(n,t,i,r,u,e){var f=t[r];if(o(n)&&isNaN(Number(f)))for(var c=0,s=n.length;c<s;c++)if(!h(n[c],t,i,r,c,n))return!1;return r===t.length||null==n?i(n,u,e):h(n[f],t,i,r+1,f,n)},a=function(){function n(n,t,i){this.params=n,this.owneryQuery=t,this.options=i,this.init()}return n.prototype.init=function(){},n.prototype.reset=function(){this.done=!1,this.success=!1},n}(),l=function(n){function t(t,i,r,u){var e=n.call(this,t,i,r)||this;return e.t=u,e}return i(t,n),t.prototype.reset=function(){this.success=!1,this.done=!1;for(var n=0,t=this.t.length;n<t;n++)this.t[n].reset()},t.prototype.childrenNext=function(n,t,i){for(var r=!0,u=!0,e=0,o=this.t.length;e<o;e++){var f=this.t[e];if(f.next(n,t,i),f.success||(u=!1),f.done){if(!f.success)break}else r=!1}this.done=r,this.success=u},t}(a),v=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(n,t,i){this.childrenNext(n,t,i)},t}(l),w=function(n){function t(t,i,r,u,e){var o=n.call(this,i,r,u,e)||this;return o.keyPath=t,o.i=function(n,t,i){return o.childrenNext(n,t,i),!o.done},o}return i(t,n),t.prototype.next=function(n,t,i){h(n,this.keyPath,this.i,0,t,i)},t}(l),p=function(n,t){if(n instanceof Function)return n;if(n instanceof RegExp)return function(t){var i="string"==typeof t&&n.test(t);return n.lastIndex=0,i};var i=e(n);return function(n){return t(i,e(n))}},$=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.u=p(this.params,this.options.compare)},t.prototype.next=function(n,t,i){this.u(n,t,i)&&(this.done=!0,this.success=!0)},t}(a),b=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(){this.done=!0,this.success=!1},t}(a),d=function(n){return t=function(t,i,r){var u=typeof e(t),o=n(t);return new $((function(n){return typeof e(n)===u&&o(n)}),i,r)},function(n,i,r){return null==n?new b(n,i,r):t(n,i,r)};var t},j=function(n,t,i,r){var u=r.operations[n];if(!u)throw new Error("Unsupported operation: "+n);return u(t,i,r)},y=function(n){for(var t in n)if("$"===t.charAt(0))return!0;return!1},O=function(n,t,i,r){if(y(t)){var u=m(t,r),e=u[0];if(u[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new w(n,t,i,r,e)}return new w(n,t,i,r,[new $(t,i,r)])},_=function(n,t,i){var r=m(n,i),u=r[0],e=r[1],o=[];return u.length&&o.push(new w([],n,t,i,u)),o.push.apply(o,e),1===o.length?o[0]:new v(n,t,i,o)},m=function(n,t){var i,r=[],u=[];if(!(i=n)||i.constructor!==Object&&i.constructor!==Array&&"function Object() { [native code] }"!==i.constructor.toString()&&"function Array() { [native code] }"!==i.constructor.toString()||i.toJSON)return r.push(new $(n,n,t)),[r,u];for(var e in n)if("$"===e.charAt(0)){var o=j(e,n[e],n,t);null!=o&&r.push(o)}else u.push(O(e.split("."),n[e],n,t));return[r,u]},x=function(n,t){var i=void 0===t?{}:t,r=i.compare,u=i.operations,e=_(n,null,{compare:r||s,operations:Object.assign({},u||{})});return function(n,t,i){return e.reset(),e.next(n,t,i),e.success}},g=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.u=p(this.params,this.options.compare)},t.prototype.reset=function(){n.prototype.reset.call(this),this.success=!0},t.prototype.next=function(n){this.u(n)&&(this.done=!0,this.success=!1)},t}(a),E=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.o=_(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){this.o.reset()},t.prototype.next=function(n,t,i){this.o.reset(),o(i)?(this.o.next(n,t,i),this.done=this.o.done||t===i.length-1,this.success=this.o.success):(this.done=!0,this.success=!1)},t}(a),A=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){this.o=_(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){this.o.reset()},t.prototype.next=function(n,t,i){this.o.next(n,t,i),this.done=this.o.done,this.success=!this.o.success},t}(a),k=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){var n=this;this.s=this.params.map((function(t){return _(t,null,n.options)}))},t.prototype.reset=function(){this.done=!1,this.success=!1;for(var n=0,t=this.s.length;n<t;n++)this.s[n].reset()},t.prototype.next=function(n,t,i){for(var r=!1,u=!1,e=0,o=this.s.length;e<o;e++){var f=this.s[e];if(f.next(n,t,i),f.success){r=!0,u=f.success;break}}this.success=u,this.done=r},t}(a),F=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(t,i,r){n.prototype.next.call(this,t,i,r),this.success=!this.success},t}(k),N=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.init=function(){var n=this;this.h=this.params.map((function(t){if(y(t))throw new Error("cannot nest $ under "+n.constructor.name.toLowerCase());return p(t,n.options.compare)}))},t.prototype.next=function(n,t,i){for(var r=!1,u=!1,e=0,o=this.h.length;e<o;e++){if((0,this.h[e])(n)){r=!0,u=!0;break}}this.success=u,this.done=r},t}(a),q=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(t,i,r){n.prototype.next.call(this,t,i,r),this.success=!this.success},t}(N),M=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return i(t,n),t.prototype.next=function(n,t,i){i.hasOwnProperty(t)===this.params&&(this.done=!0,this.success=!0)},t}(a),P=function(n){function t(t,i,r){return n.call(this,t,i,r,t.map((function(n){return _(n,i,r)})))||this}return i(t,n),t.prototype.next=function(n,t,i){this.childrenNext(n,t,i)},t}(l),R=function(n,t,i){return new $(n,t,i)},z=function(n,t,i){return new g(n,t,i)},C=function(n,t,i){return new k(n,t,i)},D=function(n,t,i){return new F(n,t,i)},I=function(n,t,i){return new E(n,t,i)},S=function(n,t,i){return new q(n,t,i)},U=function(n,t,i){return new N(n,t,i)},B=d((function(n){return function(t){return t<n}})),G=d((function(n){return function(t){return t<=n}})),H=d((function(n){return function(t){return t>n}})),J=d((function(n){return function(t){return t>=n}})),K=function(n,t,i){var r=n[0],u=n[1];return new $((function(n){return e(n)%r===u}),t,i)},L=function(n,t,i){return new M(n,t,i)},Q=function(n,t,i){return new $(new RegExp(n,t.$options),t,i)},T=function(n,t,i){return new A(n,t,i)},V=function(n,t,i){return new $((function(t){return null!=t&&(t instanceof n||t.constructor===n)}),t,i)},W=function(n,t,i){return new P(n,t,i)},X=W,Y=function(n,t,i){return new $((function(t){return t&&t.length===n}),t,i)},Z=function(){return null},nn=function(n,t,i){var r;if(c(n))r=n;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');r=new Function("obj","return "+n)}return new $((function(n){return r.bind(n)(n)}),t,i)},tn=Object.freeze({__proto__:null,$eq:R,$ne:z,$or:C,$nor:D,$elemMatch:I,$nin:S,$in:U,$lt:B,$lte:G,$gt:H,$gte:J,$mod:K,$exists:L,$regex:Q,$not:T,$type:V,$and:W,$all:X,$size:Y,$options:Z,$where:nn});n.$all=X,n.$and=W,n.$elemMatch=I,n.$eq=R,n.$exists=L,n.$gt=H,n.$gte=J,n.$in=U,n.$lt=B,n.$lte=G,n.$mod=K,n.$ne=z,n.$nin=S,n.$nor=D,n.$not=T,n.$options=Z,n.$or=C,n.$regex=Q,n.$size=Y,n.$type=V,n.$where=nn,n.EqualsOperation=$,n.createEqualsOperation=function(n,t,i){return new $(n,t,i)},n.createQueryTester=x,n.default=function(n,t){var i=void 0===t?{}:t,r=i.compare,u=i.operations;return x(n,{compare:r,operations:Object.assign({},tn,u)})},Object.defineProperty(n,"l",{value:!0})}));
//# sourceMappingURL=sift.min.js.map

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc