Socket
Socket
Sign inDemoInstall

sift

Package Overview
Dependencies
Maintainers
2
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sift - npm Package Compare versions

Comparing version 11.0.9 to 11.0.10

3

es5m/core.js

@@ -220,3 +220,4 @@ var __extends = (this && this.__extends) || (function () {

if (!isVanillaObject(query)) {
query = { $eq: query };
selfOperations.push(new EqualsOperation(query, query, options));
return [selfOperations, nestedOperations];
}

@@ -223,0 +224,0 @@ for (var key in query) {

@@ -222,3 +222,4 @@ "use strict";

if (!utils_1.isVanillaObject(query)) {
query = { $eq: query };
selfOperations.push(new EqualsOperation(query, query, options));
return [selfOperations, nestedOperations];
}

@@ -225,0 +226,0 @@ for (var key in query) {

{
"name": "sift",
"description": "mongodb query style array filtering",
"version": "11.0.9",
"version": "11.0.10",
"repository": "crcn/sift.js",

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

@@ -86,10 +86,36 @@ **Installation**: `npm install sift`, or `yarn add sift`

Creates a filter function **without** built-in MongoDB query operations. This is useful
Creates a filter function **without** built-in MongoDB query operations. This is useful
if you're looking to omit certain operations from application bundles. See [Omitting built-in operations](#omitting-built-in-operations) for more info.
#### createEqualsOperation(params: any, ownerQuery: Query, options: Options): Operation
```javascript
import { createQueryTester } from "sift";
import { $eq, $in } from "sift/operations";
const filter = createQueryTester({ $eq: 5 }, { operations: { $eq, $in } });
```
Used for [custom operations](#custom-operations).
### createEqualsOperation(params: any, ownerQuery: Query, options: Options): Operation
Used for [custom operations](#custom-operations).
```javascript
import { createQueryTester, createEqualsOperation } from "sift";
import { $eq, $in } from "sift/operations";
const filter = createQueryTester(
{ $mod: 5 },
{
operations: {
$something(mod, ownerQuery, options) {
return createEqualsOperation(
value => value % mod === 0,
ownerQuery,
options
);
}
}
}
);
filter(10); // true
filter(11); // false
```
## Supported Operators

@@ -96,0 +122,0 @@

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sift=n():t.sift=n()}(this,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){"use strict";e.r(n);var r,o=function(t){var n="[object "+t+"]";return function(t){return i(t)===n}},i=function(t){return Object.prototype.toString.call(t)},u=function(t){return t instanceof Date?t.getTime():c(t)?t.map(u):t&&"function"==typeof t.toJSON?t.toJSON():t},c=o("Array"),s=o("Object"),f=(o("Function"),function(t,n){if(null==t&&t==n)return!0;if(t===n)return!0;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(n))return!1;if(c(t)){if(t.length!==n.length)return!1;for(var e=0,r=t.length;e<r;e++)if(!f(t[e],n[e]))return!1;return!0}if(s(t)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var o in t)if(!f(t[o],n[o]))return!1;return!0}return!1}),a=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),p=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r},l=function(t,n,e,r,o,i){var u=n[r];if(c(t)&&isNaN(Number(u)))for(var s=0,f=t.length;s<f;s++)if(!l(t[s],n,e,r,s,t))return!1;return r===n.length||null==t?e(t,o,i):l(t[u],n,e,r+1,u,t)},h=function(){function t(t,n,e){this.params=t,this.owneryQuery=n,this.options=e,this.init()}return t.prototype.init=function(){},t.prototype.reset=function(){this.done=!1,this.success=!1},t}(),y=function(t){function n(n,e,r,o){var i=t.call(this,n,e,r)||this;return i._children=o,i}return a(n,t),n.prototype.reset=function(){this.success=!1,this.done=!1;for(var t=0,n=this._children.length;t<n;t++)this._children[t].reset()},n.prototype.childrenNext=function(t,n,e){for(var r=!0,o=!0,i=0,u=this._children.length;i<u;i++){var c=this._children[i];if(c.next(t,n,e),c.success||(o=!1),c.done){if(!c.success)break}else r=!1}this.done=r,this.success=o},n}(h),d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.next=function(t,n,e){this.childrenNext(t,n,e)},n}(y),v=function(t){function n(n,e,r,o,i){var u=t.call(this,e,r,o,i)||this;return u.keyPath=n,u._nextNestedValue=function(t,n,e){return u.childrenNext(t,n,e),!u.done},u}return a(n,t),n.prototype.next=function(t,n,e){l(t,this.keyPath,this._nextNestedValue,0,n,e)},n}(y),b=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.init=function(){this._test=function(t,n){if(t instanceof Function)return t;if(t instanceof RegExp)return function(n){return"string"==typeof n&&t.test(n)};var e=u(t);return function(t){return n(e,u(t))}}(this.params,this.options.compare)},n.prototype.next=function(t,n,e){this._test(t,n,e)&&(this.done=!0,this.success=!0)},n}(h),g=(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}a(n,t),n.prototype.next=function(){this.done=!0,this.success=!1}}(h),function(t,n,e,r){var o=r.operations[t];if(!o)throw new Error("Unsupported operation: "+t);return o(n,e,r)}),O=function(t,n,e,r){if(function(t){for(var n in t)if("$"===n.charAt(0))return!0;return!1}(n)){var o=j(n,r),i=o[0];if(o[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new v(t,n,e,r,i)}return new v(t,n,e,r,[new b(n,e,r)])},j=function(t,n){var e,r=[],o=[];for(var i in(!(e=t)||e.constructor!==Object&&e.constructor!==Array&&"function Object() { [native code] }"!==e.constructor.toString()&&"function Array() { [native code] }"!==e.constructor.toString()||e.toJSON)&&(t={$eq:t}),t)if("$"===i.charAt(0)){var u=g(i,t[i],t,n);null!=u&&r.push(u)}else o.push(O(i.split("."),t[i],t,n));return[r,o]};_={$test:1},x={operations:{$where:defaultOperations.$where,$test:(t,n)=>new b(t,n)}},w=(m=void 0===x?{}:x).compare,S=m.operations,N=function(t,n,e){var r=j(t,e),o=r[0],i=r[1],u=p([new v([],t,n,e,o)],i);return 1===u.length?u[0]:new d(t,n,e,u)}(_,null,{compare:w||f,operations:Object.assign({},S||{})});var _,x,m,w,S,N}])}));
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sift=n():t.sift=n()}(this,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){"use strict";e.r(n);var r,o=function(t){var n="[object "+t+"]";return function(t){return i(t)===n}},i=function(t){return Object.prototype.toString.call(t)},u=function(t){return t instanceof Date?t.getTime():c(t)?t.map(u):t&&"function"==typeof t.toJSON?t.toJSON():t},c=o("Array"),s=o("Object"),f=(o("Function"),function(t,n){if(null==t&&t==n)return!0;if(t===n)return!0;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(n))return!1;if(c(t)){if(t.length!==n.length)return!1;for(var e=0,r=t.length;e<r;e++)if(!f(t[e],n[e]))return!1;return!0}if(s(t)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var o in t)if(!f(t[o],n[o]))return!1;return!0}return!1}),a=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),p=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r},l=function(t,n,e,r,o,i){var u=n[r];if(c(t)&&isNaN(Number(u)))for(var s=0,f=t.length;s<f;s++)if(!l(t[s],n,e,r,s,t))return!1;return r===n.length||null==t?e(t,o,i):l(t[u],n,e,r+1,u,t)},h=function(){function t(t,n,e){this.params=t,this.owneryQuery=n,this.options=e,this.init()}return t.prototype.init=function(){},t.prototype.reset=function(){this.done=!1,this.success=!1},t}(),y=function(t){function n(n,e,r,o){var i=t.call(this,n,e,r)||this;return i._children=o,i}return a(n,t),n.prototype.reset=function(){this.success=!1,this.done=!1;for(var t=0,n=this._children.length;t<n;t++)this._children[t].reset()},n.prototype.childrenNext=function(t,n,e){for(var r=!0,o=!0,i=0,u=this._children.length;i<u;i++){var c=this._children[i];if(c.next(t,n,e),c.success||(o=!1),c.done){if(!c.success)break}else r=!1}this.done=r,this.success=o},n}(h),d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.next=function(t,n,e){this.childrenNext(t,n,e)},n}(y),v=function(t){function n(n,e,r,o,i){var u=t.call(this,e,r,o,i)||this;return u.keyPath=n,u._nextNestedValue=function(t,n,e){return u.childrenNext(t,n,e),!u.done},u}return a(n,t),n.prototype.next=function(t,n,e){l(t,this.keyPath,this._nextNestedValue,0,n,e)},n}(y),b=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.init=function(){this._test=function(t,n){if(t instanceof Function)return t;if(t instanceof RegExp)return function(n){return"string"==typeof n&&t.test(n)};var e=u(t);return function(t){return n(e,u(t))}}(this.params,this.options.compare)},n.prototype.next=function(t,n,e){this._test(t,n,e)&&(this.done=!0,this.success=!0)},n}(h),g=(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}a(n,t),n.prototype.next=function(){this.done=!0,this.success=!1}}(h),function(t,n,e,r){var o=r.operations[t];if(!o)throw new Error("Unsupported operation: "+t);return o(n,e,r)}),O=function(t,n,e,r){if(function(t){for(var n in t)if("$"===n.charAt(0))return!0;return!1}(n)){var o=j(n,r),i=o[0];if(o[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new v(t,n,e,r,i)}return new v(t,n,e,r,[new b(n,e,r)])},j=function(t,n){var e,r=[],o=[];if(!(e=t)||e.constructor!==Object&&e.constructor!==Array&&"function Object() { [native code] }"!==e.constructor.toString()&&"function Array() { [native code] }"!==e.constructor.toString()||e.toJSON)return r.push(new b(t,t,n)),[r,o];for(var i in t)if("$"===i.charAt(0)){var u=g(i,t[i],t,n);null!=u&&r.push(u)}else o.push(O(i.split("."),t[i],t,n));return[r,o]};_={$test:1},x={operations:{$where:defaultOperations.$where,$test:(t,n)=>new b(t,n)}},w=(m=void 0===x?{}:x).compare,S=m.operations,N=function(t,n,e){var r=j(t,e),o=r[0],i=r[1],u=p([new v([],t,n,e,o)],i);return 1===u.length?u[0]:new d(t,n,e,u)}(_,null,{compare:w||f,operations:Object.assign({},S||{})});var _,x,m,w,S,N}])}));
//# sourceMappingURL=sift.csp.min.js.map

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sift=n():t.sift=n()}(this,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){"use strict";e.r(n);var r,o=function(t){var n="[object "+t+"]";return function(t){return i(t)===n}},i=function(t){return Object.prototype.toString.call(t)},u=function(t){return t instanceof Date?t.getTime():c(t)?t.map(u):t&&"function"==typeof t.toJSON?t.toJSON():t},c=o("Array"),s=o("Object"),f=(o("Function"),function(t,n){if(null==t&&t==n)return!0;if(t===n)return!0;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(n))return!1;if(c(t)){if(t.length!==n.length)return!1;for(var e=0,r=t.length;e<r;e++)if(!f(t[e],n[e]))return!1;return!0}if(s(t)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var o in t)if(!f(t[o],n[o]))return!1;return!0}return!1}),a=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),p=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r},l=function(t,n,e,r,o,i){var u=n[r];if(c(t)&&isNaN(Number(u)))for(var s=0,f=t.length;s<f;s++)if(!l(t[s],n,e,r,s,t))return!1;return r===n.length||null==t?e(t,o,i):l(t[u],n,e,r+1,u,t)},h=function(){function t(t,n,e){this.params=t,this.owneryQuery=n,this.options=e,this.init()}return t.prototype.init=function(){},t.prototype.reset=function(){this.done=!1,this.success=!1},t}(),y=function(t){function n(n,e,r,o){var i=t.call(this,n,e,r)||this;return i._children=o,i}return a(n,t),n.prototype.reset=function(){this.success=!1,this.done=!1;for(var t=0,n=this._children.length;t<n;t++)this._children[t].reset()},n.prototype.childrenNext=function(t,n,e){for(var r=!0,o=!0,i=0,u=this._children.length;i<u;i++){var c=this._children[i];if(c.next(t,n,e),c.success||(o=!1),c.done){if(!c.success)break}else r=!1}this.done=r,this.success=o},n}(h),d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.next=function(t,n,e){this.childrenNext(t,n,e)},n}(y),v=function(t){function n(n,e,r,o,i){var u=t.call(this,e,r,o,i)||this;return u.keyPath=n,u._nextNestedValue=function(t,n,e){return u.childrenNext(t,n,e),!u.done},u}return a(n,t),n.prototype.next=function(t,n,e){l(t,this.keyPath,this._nextNestedValue,0,n,e)},n}(y),b=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.init=function(){this._test=function(t,n){if(t instanceof Function)return t;if(t instanceof RegExp)return function(n){return"string"==typeof n&&t.test(n)};var e=u(t);return function(t){return n(e,u(t))}}(this.params,this.options.compare)},n.prototype.next=function(t,n,e){this._test(t,n,e)&&(this.done=!0,this.success=!0)},n}(h),g=(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}a(n,t),n.prototype.next=function(){this.done=!0,this.success=!1}}(h),function(t,n,e,r){var o=r.operations[t];if(!o)throw new Error("Unsupported operation: "+t);return o(n,e,r)}),O=function(t,n,e,r){if(function(t){for(var n in t)if("$"===n.charAt(0))return!0;return!1}(n)){var o=j(n,r),i=o[0];if(o[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new v(t,n,e,r,i)}return new v(t,n,e,r,[new b(n,e,r)])},j=function(t,n){var e,r=[],o=[];for(var i in(!(e=t)||e.constructor!==Object&&e.constructor!==Array&&"function Object() { [native code] }"!==e.constructor.toString()&&"function Array() { [native code] }"!==e.constructor.toString()||e.toJSON)&&(t={$eq:t}),t)if("$"===i.charAt(0)){var u=g(i,t[i],t,n);null!=u&&r.push(u)}else o.push(O(i.split("."),t[i],t,n));return[r,o]};_={$test:1},x={operations:{$where:defaultOperations.$where,$test:(t,n)=>new b(t,n)}},w=(m=void 0===x?{}:x).compare,S=m.operations,N=function(t,n,e){var r=j(t,e),o=r[0],i=r[1],u=p([new v([],t,n,e,o)],i);return 1===u.length?u[0]:new d(t,n,e,u)}(_,null,{compare:w||f,operations:Object.assign({},S||{})});var _,x,m,w,S,N}])}));
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sift=n():t.sift=n()}(this,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){"use strict";e.r(n);var r,o=function(t){var n="[object "+t+"]";return function(t){return i(t)===n}},i=function(t){return Object.prototype.toString.call(t)},u=function(t){return t instanceof Date?t.getTime():c(t)?t.map(u):t&&"function"==typeof t.toJSON?t.toJSON():t},c=o("Array"),s=o("Object"),f=(o("Function"),function(t,n){if(null==t&&t==n)return!0;if(t===n)return!0;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(n))return!1;if(c(t)){if(t.length!==n.length)return!1;for(var e=0,r=t.length;e<r;e++)if(!f(t[e],n[e]))return!1;return!0}if(s(t)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var o in t)if(!f(t[o],n[o]))return!1;return!0}return!1}),a=(r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)},function(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),p=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var r=Array(t),o=0;for(n=0;n<e;n++)for(var i=arguments[n],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r},l=function(t,n,e,r,o,i){var u=n[r];if(c(t)&&isNaN(Number(u)))for(var s=0,f=t.length;s<f;s++)if(!l(t[s],n,e,r,s,t))return!1;return r===n.length||null==t?e(t,o,i):l(t[u],n,e,r+1,u,t)},h=function(){function t(t,n,e){this.params=t,this.owneryQuery=n,this.options=e,this.init()}return t.prototype.init=function(){},t.prototype.reset=function(){this.done=!1,this.success=!1},t}(),y=function(t){function n(n,e,r,o){var i=t.call(this,n,e,r)||this;return i._children=o,i}return a(n,t),n.prototype.reset=function(){this.success=!1,this.done=!1;for(var t=0,n=this._children.length;t<n;t++)this._children[t].reset()},n.prototype.childrenNext=function(t,n,e){for(var r=!0,o=!0,i=0,u=this._children.length;i<u;i++){var c=this._children[i];if(c.next(t,n,e),c.success||(o=!1),c.done){if(!c.success)break}else r=!1}this.done=r,this.success=o},n}(h),d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.next=function(t,n,e){this.childrenNext(t,n,e)},n}(y),v=function(t){function n(n,e,r,o,i){var u=t.call(this,e,r,o,i)||this;return u.keyPath=n,u._nextNestedValue=function(t,n,e){return u.childrenNext(t,n,e),!u.done},u}return a(n,t),n.prototype.next=function(t,n,e){l(t,this.keyPath,this._nextNestedValue,0,n,e)},n}(y),b=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.init=function(){this._test=function(t,n){if(t instanceof Function)return t;if(t instanceof RegExp)return function(n){return"string"==typeof n&&t.test(n)};var e=u(t);return function(t){return n(e,u(t))}}(this.params,this.options.compare)},n.prototype.next=function(t,n,e){this._test(t,n,e)&&(this.done=!0,this.success=!0)},n}(h),g=(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}a(n,t),n.prototype.next=function(){this.done=!0,this.success=!1}}(h),function(t,n,e,r){var o=r.operations[t];if(!o)throw new Error("Unsupported operation: "+t);return o(n,e,r)}),O=function(t,n,e,r){if(function(t){for(var n in t)if("$"===n.charAt(0))return!0;return!1}(n)){var o=j(n,r),i=o[0];if(o[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new v(t,n,e,r,i)}return new v(t,n,e,r,[new b(n,e,r)])},j=function(t,n){var e,r=[],o=[];if(!(e=t)||e.constructor!==Object&&e.constructor!==Array&&"function Object() { [native code] }"!==e.constructor.toString()&&"function Array() { [native code] }"!==e.constructor.toString()||e.toJSON)return r.push(new b(t,t,n)),[r,o];for(var i in t)if("$"===i.charAt(0)){var u=g(i,t[i],t,n);null!=u&&r.push(u)}else o.push(O(i.split("."),t[i],t,n));return[r,o]};_={$test:1},x={operations:{$where:defaultOperations.$where,$test:(t,n)=>new b(t,n)}},w=(m=void 0===x?{}:x).compare,S=m.operations,N=function(t,n,e){var r=j(t,e),o=r[0],i=r[1],u=p([new v([],t,n,e,o)],i);return 1===u.length?u[0]:new d(t,n,e,u)}(_,null,{compare:w||f,operations:Object.assign({},S||{})});var _,x,m,w,S,N}])}));
//# sourceMappingURL=sift.min.js.map

@@ -320,3 +320,4 @@ import {

if (!isVanillaObject(query)) {
query = { $eq: query };
selfOperations.push(new EqualsOperation(query, query, options));
return [selfOperations, nestedOperations];
}

@@ -323,0 +324,0 @@ for (const key in query) {

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc