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

Comparing version 13.5.4 to 14.0.0

85

es/index.js

@@ -150,2 +150,6 @@ const typeChecker = (type) => {

class QueryOperation extends GroupOperation {
constructor() {
super(...arguments);
this.propop = true;
}
/**

@@ -161,2 +165,3 @@ */

this.keyPath = keyPath;
this.propop = true;
/**

@@ -190,2 +195,6 @@ */

class EqualsOperation extends BaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
init() {

@@ -205,2 +214,6 @@ this._test = createTester(this.params, this.options.compare);

class NopeOperation extends BaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
next() {

@@ -238,5 +251,5 @@ this.done = true;

};
const createNestedOperation = (keyPath, nestedQuery, owneryQuery, options) => {
const createNestedOperation = (keyPath, nestedQuery, parentKey, owneryQuery, options) => {
if (containsOperation(nestedQuery)) {
const [selfOperations, nestedOperations] = createQueryOperations(nestedQuery, options);
const [selfOperations, nestedOperations] = createQueryOperations(nestedQuery, parentKey, options);
if (nestedOperations.length) {

@@ -256,3 +269,3 @@ throw new Error(`Property queries must contain only operations, or exact objects.`);

};
const [selfOperations, nestedOperations] = createQueryOperations(query, options);
const [selfOperations, nestedOperations] = createQueryOperations(query, null, options);
const ops = [];

@@ -268,3 +281,3 @@ if (selfOperations.length) {

};
const createQueryOperations = (query, options) => {
const createQueryOperations = (query, parentKey, options) => {
const selfOperations = [];

@@ -279,2 +292,7 @@ const nestedOperations = [];

const op = createNamedOperation(key, query[key], query, options);
if (op) {
if (!op.propop && parentKey && parentKey.charAt(0) !== "$") {
throw new Error(`Malformed query. ${key} cannot be matched against property.`);
}
}
// probably just a flag for another operation (like $options)

@@ -286,3 +304,3 @@ if (op != null) {

else {
nestedOperations.push(createNestedOperation(key.split("."), query[key], query, options));
nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options));
}

@@ -302,2 +320,6 @@ }

class $Ne extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
init() {

@@ -319,2 +341,6 @@ this._test = createTester(this.params, this.options.compare);

class $ElemMatch extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
init() {

@@ -333,5 +359,8 @@ this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);

this._queryOperation.reset();
// check item
this._queryOperation.next(item[i], i, item);
this.keep = this.keep || this._queryOperation.keep;
const child = item[i];
if (child && typeof child === "object") {
// check item
this._queryOperation.next(child, i, item);
this.keep = this.keep || this._queryOperation.keep;
}
}

@@ -347,2 +376,6 @@ this.done = true;

class $Not extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
init() {

@@ -361,2 +394,6 @@ this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options);

class $Size extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
init() { }

@@ -375,2 +412,6 @@ next(item) {

class $Or extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = false;
}
init() {

@@ -403,2 +444,6 @@ this._ops = this.params.map(op => createQueryOperation(op, null, this.options));

class $Nor extends $Or {
constructor() {
super(...arguments);
this.propop = false;
}
next(item, key, owner) {

@@ -410,2 +455,6 @@ super.next(item, key, owner);

class $In extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
init() {

@@ -435,2 +484,6 @@ this._testers = this.params.map(value => {

class $Nin extends $In {
constructor() {
super(...arguments);
this.propop = true;
}
next(item, key, owner) {

@@ -442,2 +495,6 @@ super.next(item, key, owner);

class $Exists extends NamedBaseOperation {
constructor() {
super(...arguments);
this.propop = true;
}
next(item, key, owner) {

@@ -453,2 +510,3 @@ if (owner.hasOwnProperty(key) === this.params) {

super(params, owneryQuery, options, params.map(query => createQueryOperation(query, owneryQuery, options)), name);
this.propop = false;
}

@@ -459,2 +517,11 @@ next(item, key, owner) {

}
class $All extends NamedGroupOperation {
constructor(params, owneryQuery, options, name) {
super(params, owneryQuery, options, params.map(query => createQueryOperation(query, owneryQuery, options)), name);
this.propop = true;
}
next(item, key, owner) {
this.childrenNext(item, key, owner);
}
}
const $eq = (params, owneryQuery, options) => new EqualsOperation(params, owneryQuery, options);

@@ -493,3 +560,3 @@ const $ne = (params, owneryQuery, options, name) => new $Ne(params, owneryQuery, options, name);

const $and = (params, ownerQuery, options, name) => new $And(params, ownerQuery, options, name);
const $all = $and;
const $all = (params, ownerQuery, options, name) => new $All(params, ownerQuery, options, name);
const $size = (params, ownerQuery, options) => new $Size(params, ownerQuery, options, "$size");

@@ -496,0 +563,0 @@ const $options = () => null;

91

es5m/index.js

@@ -193,3 +193,5 @@ /*! *****************************************************************************

function QueryOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -208,2 +210,3 @@ /**

_this.keyPath = keyPath;
_this.propop = true;
/**

@@ -241,3 +244,5 @@ */

function EqualsOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -261,3 +266,5 @@ EqualsOperation.prototype.init = function () {

function NopeOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -299,5 +306,5 @@ NopeOperation.prototype.next = function () {

};
var createNestedOperation = function (keyPath, nestedQuery, owneryQuery, options) {
var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) {
if (containsOperation(nestedQuery)) {
var _a = createQueryOperations(nestedQuery, options), selfOperations = _a[0], nestedOperations = _a[1];
var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1];
if (nestedOperations.length) {

@@ -319,3 +326,3 @@ throw new Error("Property queries must contain only operations, or exact objects.");

};
var _c = createQueryOperations(query, options), selfOperations = _c[0], nestedOperations = _c[1];
var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1];
var ops = [];

@@ -331,3 +338,3 @@ if (selfOperations.length) {

};
var createQueryOperations = function (query, options) {
var createQueryOperations = function (query, parentKey, options) {
var selfOperations = [];

@@ -342,2 +349,7 @@ var nestedOperations = [];

var op = createNamedOperation(key, query[key], query, options);
if (op) {
if (!op.propop && parentKey && parentKey.charAt(0) !== "$") {
throw new Error("Malformed query. " + key + " cannot be matched against property.");
}
}
// probably just a flag for another operation (like $options)

@@ -349,3 +361,3 @@ if (op != null) {

else {
nestedOperations.push(createNestedOperation(key.split("."), query[key], query, options));
nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options));
}

@@ -368,3 +380,5 @@ }

function $Ne() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -390,3 +404,5 @@ $Ne.prototype.init = function () {

function $ElemMatch() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -406,5 +422,8 @@ $ElemMatch.prototype.init = function () {

this._queryOperation.reset();
// check item
this._queryOperation.next(item[i], i, item);
this.keep = this.keep || this._queryOperation.keep;
var child = item[i];
if (child && typeof child === "object") {
// check item
this._queryOperation.next(child, i, item);
this.keep = this.keep || this._queryOperation.keep;
}
}

@@ -423,3 +442,5 @@ this.done = true;

function $Not() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -442,3 +463,5 @@ $Not.prototype.init = function () {

function $Size() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -461,3 +484,5 @@ $Size.prototype.init = function () { };

function $Or() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = false;
return _this;
}

@@ -497,3 +522,5 @@ $Or.prototype.init = function () {

function $Nor() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = false;
return _this;
}

@@ -509,3 +536,5 @@ $Nor.prototype.next = function (item, key, owner) {

function $In() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -540,3 +569,5 @@ $In.prototype.init = function () {

function $Nin() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -552,3 +583,5 @@ $Nin.prototype.next = function (item, key, owner) {

function $Exists() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -566,3 +599,5 @@ $Exists.prototype.next = function (item, key, owner) {

function $And(params, owneryQuery, options, name) {
return _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
_this.propop = false;
return _this;
}

@@ -574,2 +609,14 @@ $And.prototype.next = function (item, key, owner) {

}(NamedGroupOperation));
var $All = /** @class */ (function (_super) {
__extends($All, _super);
function $All(params, owneryQuery, options, name) {
var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
_this.propop = true;
return _this;
}
$All.prototype.next = function (item, key, owner) {
this.childrenNext(item, key, owner);
};
return $All;
}(NamedGroupOperation));
var $eq = function (params, owneryQuery, options) {

@@ -617,3 +664,3 @@ return new EqualsOperation(params, owneryQuery, options);

var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); };
var $all = $and;
var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); };
var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); };

@@ -620,0 +667,0 @@ var $options = function () { return null; };

@@ -5,2 +5,3 @@ import { Key, Comparator } from "./utils";

readonly done: boolean;
propop: boolean;
reset(): any;

@@ -53,2 +54,3 @@ next(item: TItem, key?: Key, owner?: any): any;

done: boolean;
abstract propop: boolean;
constructor(params: TParams, owneryQuery: any, options: Options);

@@ -61,2 +63,3 @@ protected init(): void;

readonly name: string;
abstract propop: boolean;
constructor(params: TParams, owneryQuery: any, options: Options, name: string);

@@ -79,5 +82,7 @@ }

readonly name: string;
abstract propop: boolean;
constructor(params: any, owneryQuery: any, options: Options, children: Operation<any>[], name: string);
}
export declare class QueryOperation<TItem> extends GroupOperation {
readonly propop = true;
/**

@@ -89,2 +94,3 @@ */

readonly keyPath: Key[];
readonly propop = true;
constructor(keyPath: Key[], params: any, owneryQuery: any, options: Options, children: Operation<any>[]);

@@ -100,2 +106,3 @@ /**

export declare class EqualsOperation<TParam> extends BaseOperation<TParam> {
readonly propop = true;
private _test;

@@ -107,2 +114,3 @@ init(): void;

export declare class NopeOperation<TParam> extends BaseOperation<TParam> {
readonly propop = true;
next(): void;

@@ -109,0 +117,0 @@ }

@@ -199,3 +199,5 @@ (function (global, factory) {

function QueryOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -214,2 +216,3 @@ /**

_this.keyPath = keyPath;
_this.propop = true;
/**

@@ -247,3 +250,5 @@ */

function EqualsOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -267,3 +272,5 @@ EqualsOperation.prototype.init = function () {

function NopeOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -305,5 +312,5 @@ NopeOperation.prototype.next = function () {

};
var createNestedOperation = function (keyPath, nestedQuery, owneryQuery, options) {
var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) {
if (containsOperation(nestedQuery)) {
var _a = createQueryOperations(nestedQuery, options), selfOperations = _a[0], nestedOperations = _a[1];
var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1];
if (nestedOperations.length) {

@@ -325,3 +332,3 @@ throw new Error("Property queries must contain only operations, or exact objects.");

};
var _c = createQueryOperations(query, options), selfOperations = _c[0], nestedOperations = _c[1];
var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1];
var ops = [];

@@ -337,3 +344,3 @@ if (selfOperations.length) {

};
var createQueryOperations = function (query, options) {
var createQueryOperations = function (query, parentKey, options) {
var selfOperations = [];

@@ -348,2 +355,7 @@ var nestedOperations = [];

var op = createNamedOperation(key, query[key], query, options);
if (op) {
if (!op.propop && parentKey && parentKey.charAt(0) !== "$") {
throw new Error("Malformed query. " + key + " cannot be matched against property.");
}
}
// probably just a flag for another operation (like $options)

@@ -355,3 +367,3 @@ if (op != null) {

else {
nestedOperations.push(createNestedOperation(key.split("."), query[key], query, options));
nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options));
}

@@ -374,3 +386,5 @@ }

function $Ne() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -396,3 +410,5 @@ $Ne.prototype.init = function () {

function $ElemMatch() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -412,5 +428,8 @@ $ElemMatch.prototype.init = function () {

this._queryOperation.reset();
// check item
this._queryOperation.next(item[i], i, item);
this.keep = this.keep || this._queryOperation.keep;
var child = item[i];
if (child && typeof child === "object") {
// check item
this._queryOperation.next(child, i, item);
this.keep = this.keep || this._queryOperation.keep;
}
}

@@ -429,3 +448,5 @@ this.done = true;

function $Not() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -448,3 +469,5 @@ $Not.prototype.init = function () {

function $Size() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -467,3 +490,5 @@ $Size.prototype.init = function () { };

function $Or() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = false;
return _this;
}

@@ -503,3 +528,5 @@ $Or.prototype.init = function () {

function $Nor() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = false;
return _this;
}

@@ -515,3 +542,5 @@ $Nor.prototype.next = function (item, key, owner) {

function $In() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -546,3 +575,5 @@ $In.prototype.init = function () {

function $Nin() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -558,3 +589,5 @@ $Nin.prototype.next = function (item, key, owner) {

function $Exists() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -572,3 +605,5 @@ $Exists.prototype.next = function (item, key, owner) {

function $And(params, owneryQuery, options, name) {
return _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
_this.propop = false;
return _this;
}

@@ -580,2 +615,14 @@ $And.prototype.next = function (item, key, owner) {

}(NamedGroupOperation));
var $All = /** @class */ (function (_super) {
__extends($All, _super);
function $All(params, owneryQuery, options, name) {
var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
_this.propop = true;
return _this;
}
$All.prototype.next = function (item, key, owner) {
this.childrenNext(item, key, owner);
};
return $All;
}(NamedGroupOperation));
var $eq = function (params, owneryQuery, options) {

@@ -623,3 +670,3 @@ return new EqualsOperation(params, owneryQuery, options);

var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); };
var $all = $and;
var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); };
var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); };

@@ -626,0 +673,0 @@ var $options = function () { return null; };

import { NamedBaseOperation, EqualsOperation, Options, Operation, Query, NamedGroupOperation } from "./core";
import { Key } from "./utils";
declare class $Ne extends NamedBaseOperation<any> {
readonly propop = true;
private _test;

@@ -10,2 +11,3 @@ init(): void;

declare class $ElemMatch extends NamedBaseOperation<Query<any>> {
readonly propop = true;
private _queryOperation;

@@ -17,2 +19,3 @@ init(): void;

declare class $Not extends NamedBaseOperation<Query<any>> {
readonly propop = true;
private _queryOperation;

@@ -24,2 +27,3 @@ init(): void;

export declare class $Size extends NamedBaseOperation<any> {
readonly propop = true;
init(): void;

@@ -29,2 +33,3 @@ next(item: any): void;

declare class $Or extends NamedBaseOperation<any> {
readonly propop = false;
private _ops;

@@ -36,5 +41,7 @@ init(): void;

declare class $Nor extends $Or {
readonly propop = false;
next(item: any, key: Key, owner: any): void;
}
declare class $In extends NamedBaseOperation<any> {
readonly propop = true;
private _testers;

@@ -45,11 +52,19 @@ init(): void;

declare class $Nin extends $In {
readonly propop = true;
next(item: any, key: Key, owner: any): void;
}
declare class $Exists extends NamedBaseOperation<boolean> {
readonly propop = true;
next(item: any, key: Key, owner: any): void;
}
declare class $And extends NamedGroupOperation {
readonly propop = false;
constructor(params: Query<any>[], owneryQuery: Query<any>, options: Options, name: string);
next(item: any, key: Key, owner: any): void;
}
declare class $All extends NamedGroupOperation {
readonly propop = true;
constructor(params: Query<any>[], owneryQuery: Query<any>, options: Options, name: string);
next(item: any, key: Key, owner: any): void;
}
export declare const $eq: (params: any, owneryQuery: Query<any>, options: Options) => EqualsOperation<any>;

@@ -72,3 +87,3 @@ export declare const $ne: (params: any, owneryQuery: Query<any>, options: Options, name: string) => $Ne;

export declare const $and: (params: Query<any>[], ownerQuery: Query<any>, options: Options, name: string) => $And;
export declare const $all: (params: Query<any>[], ownerQuery: Query<any>, options: Options, name: string) => $And;
export declare const $all: (params: Query<any>[], ownerQuery: Query<any>, options: Options, name: string) => $All;
export declare const $size: (params: number, ownerQuery: Query<any>, options: Options) => $Size;

@@ -75,0 +90,0 @@ export declare const $options: () => any;

{
"name": "sift",
"description": "MongoDB query filtering in JavaScript",
"version": "13.5.4",
"version": "14.0.0",
"repository": "crcn/sift.js",

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

@@ -290,3 +290,3 @@ **Installation**: `npm install sift`, or `yarn add sift`

```javascript
//filtered: [ { name: 'Tim', state: 'MN' }, { name: 'Joe', state: 'CA' }]
//filtered: [{ name: 'Joe', state: 'CA' }]
[

@@ -293,0 +293,0 @@ { name: "Craig", state: "MN" },

@@ -199,3 +199,5 @@ (function (global, factory) {

function QueryOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -214,2 +216,3 @@ /**

_this.keyPath = keyPath;
_this.propop = true;
/**

@@ -247,3 +250,5 @@ */

function EqualsOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -267,3 +272,5 @@ EqualsOperation.prototype.init = function () {

function NopeOperation() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -305,5 +312,5 @@ NopeOperation.prototype.next = function () {

};
var createNestedOperation = function (keyPath, nestedQuery, owneryQuery, options) {
var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) {
if (containsOperation(nestedQuery)) {
var _a = createQueryOperations(nestedQuery, options), selfOperations = _a[0], nestedOperations = _a[1];
var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1];
if (nestedOperations.length) {

@@ -325,3 +332,3 @@ throw new Error("Property queries must contain only operations, or exact objects.");

};
var _c = createQueryOperations(query, options), selfOperations = _c[0], nestedOperations = _c[1];
var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1];
var ops = [];

@@ -337,3 +344,3 @@ if (selfOperations.length) {

};
var createQueryOperations = function (query, options) {
var createQueryOperations = function (query, parentKey, options) {
var selfOperations = [];

@@ -348,2 +355,7 @@ var nestedOperations = [];

var op = createNamedOperation(key, query[key], query, options);
if (op) {
if (!op.propop && parentKey && parentKey.charAt(0) !== "$") {
throw new Error("Malformed query. " + key + " cannot be matched against property.");
}
}
// probably just a flag for another operation (like $options)

@@ -355,3 +367,3 @@ if (op != null) {

else {
nestedOperations.push(createNestedOperation(key.split("."), query[key], query, options));
nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options));
}

@@ -374,3 +386,5 @@ }

function $Ne() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -396,3 +410,5 @@ $Ne.prototype.init = function () {

function $ElemMatch() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -412,5 +428,8 @@ $ElemMatch.prototype.init = function () {

this._queryOperation.reset();
// check item
this._queryOperation.next(item[i], i, item);
this.keep = this.keep || this._queryOperation.keep;
var child = item[i];
if (child && typeof child === "object") {
// check item
this._queryOperation.next(child, i, item);
this.keep = this.keep || this._queryOperation.keep;
}
}

@@ -429,3 +448,5 @@ this.done = true;

function $Not() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -448,3 +469,5 @@ $Not.prototype.init = function () {

function $Size() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -467,3 +490,5 @@ $Size.prototype.init = function () { };

function $Or() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = false;
return _this;
}

@@ -503,3 +528,5 @@ $Or.prototype.init = function () {

function $Nor() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = false;
return _this;
}

@@ -515,3 +542,5 @@ $Nor.prototype.next = function (item, key, owner) {

function $In() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -546,3 +575,5 @@ $In.prototype.init = function () {

function $Nin() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -558,3 +589,5 @@ $Nin.prototype.next = function (item, key, owner) {

function $Exists() {
return _super !== null && _super.apply(this, arguments) || this;
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.propop = true;
return _this;
}

@@ -572,3 +605,5 @@ $Exists.prototype.next = function (item, key, owner) {

function $And(params, owneryQuery, options, name) {
return _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
_this.propop = false;
return _this;
}

@@ -580,2 +615,14 @@ $And.prototype.next = function (item, key, owner) {

}(NamedGroupOperation));
var $All = /** @class */ (function (_super) {
__extends($All, _super);
function $All(params, owneryQuery, options, name) {
var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this;
_this.propop = true;
return _this;
}
$All.prototype.next = function (item, key, owner) {
this.childrenNext(item, key, owner);
};
return $All;
}(NamedGroupOperation));
var $eq = function (params, owneryQuery, options) {

@@ -623,3 +670,3 @@ return new EqualsOperation(params, owneryQuery, options);

var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); };
var $all = $and;
var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); };
var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); };

@@ -626,0 +673,0 @@ var $options = function () { return null; };

@@ -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,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,r)};function r(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i=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=i("Array"),f=i("Object"),c=i("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 r=0,i=n.length;r<i;r++)if(!s(n[r],t[r]))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,r,i,u,e){var f=t[i];if(o(n)&&isNaN(Number(f)))for(var c=0,s=n.length;c<s;c++)if(!h(n[c],t,r,i,c,n))return!1;return i===t.length||null==n?r(n,u,e):h(n[f],t,r,i+1,f,n)},a=function(){function n(n,t,r){this.params=n,this.owneryQuery=t,this.options=r,this.init()}return n.prototype.init=function(){},n.prototype.reset=function(){this.done=!1,this.keep=!1},n}(),l=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i)||this;return e.name=u,e}return r(t,n),t}(a),v=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i)||this;return e.children=u,e}return r(t,n),t.prototype.reset=function(){this.keep=!1,this.done=!1;for(var n=0,t=this.children.length;n<t;n++)this.children[n].reset()},t.prototype.childrenNext=function(n,t,r){for(var i=!0,u=!0,e=0,o=this.children.length;e<o;e++){var f=this.children[e];if(f.next(n,t,r),f.keep||(u=!1),f.done){if(!f.keep)break}else i=!1}this.done=i,this.keep=u},t}(a),w=function(n){function t(t,r,i,u,e){var o=n.call(this,t,r,i,u)||this;return o.name=e,o}return r(t,n),t}(v),p=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.next=function(n,t,r){this.childrenNext(n,t,r)},t}(v),b=function(n){function t(t,r,i,u,e){var o=n.call(this,r,i,u,e)||this;return o.keyPath=t,o.t=function(n,t,r){return o.childrenNext(n,t,r),!o.done},o}return r(t,n),t.prototype.next=function(n,t,r){h(n,this.keyPath,this.t,0,t,r)},t}(v),$=function(n,t){if(n instanceof Function)return n;if(n instanceof RegExp)return function(t){var r="string"==typeof t&&n.test(t);return n.lastIndex=0,r};var r=e(n);return function(n){return t(r,e(n))}},y=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){this.i=$(this.params,this.options.compare)},t.prototype.next=function(n,t,r){Array.isArray(r)&&!r.hasOwnProperty(t)||this.i(n,t,r)&&(this.done=!0,this.keep=!0)},t}(a),d=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.next=function(){this.done=!0,this.keep=!1},t}(a),j=function(n){return t=function(t,r,i){var u=typeof e(t),o=n(t);return new y((function(n){return typeof e(n)===u&&o(n)}),r,i)},function(n,r,i,u){return null==n?new d(n,r,i):t(n,r,i,u)};var t},O=function(n,t,r,i){var u=i.operations[n];if(!u)throw new Error("Unsupported operation: "+n);return u(t,r,i,n)},m=function(n){for(var t in n)if("$"===t.charAt(0))return!0;return!1},g=function(n,t,r,i){if(m(t)){var u=_(t,i),e=u[0];if(u[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new b(n,t,r,i,e)}return new b(n,t,r,i,[new y(t,r,i)])},x=function(n,t,r){void 0===t&&(t=null);var i=void 0===r?{}:r,u=i.compare,e=i.operations,o={compare:u||s,operations:Object.assign({},e||{})},f=_(n,o),c=f[0],h=f[1],a=[];return c.length&&a.push(new b([],n,t,o,c)),a.push.apply(a,h),1===a.length?a[0]:new p(n,t,o,a)},_=function(n,t){var r,i=[],u=[];if(!(r=n)||r.constructor!==Object&&r.constructor!==Array&&"function Object() { [native code] }"!==r.constructor.toString()&&"function Array() { [native code] }"!==r.constructor.toString()||r.toJSON)return i.push(new y(n,n,t)),[i,u];for(var e in n)if("$"===e.charAt(0)){var o=O(e,n[e],n,t);null!=o&&i.push(o)}else u.push(g(e.split("."),n[e],n,t));return[i,u]},E=function(n){return function(t,r,i){return n.reset(),n.next(t,r,i),n.keep}},A=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){this.i=$(this.params,this.options.compare)},t.prototype.reset=function(){n.prototype.reset.call(this),this.keep=!0},t.prototype.next=function(n){this.i(n)&&(this.done=!0,this.keep=!1)},t}(l),k=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){this.u=x(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){n.prototype.reset.call(this),this.u.reset()},t.prototype.next=function(n){if(o(n)){for(var t=0,r=n.length;t<r;t++)this.u.reset(),this.u.next(n[t],t,n),this.keep=this.keep||this.u.keep;this.done=!0}else this.done=!1,this.keep=!1},t}(l),z=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){this.u=x(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){this.u.reset()},t.prototype.next=function(n,t,r){this.u.next(n,t,r),this.done=this.u.done,this.keep=!this.u.keep},t}(l),F=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){},t.prototype.next=function(n){o(n)&&n.length===this.params&&(this.done=!0,this.keep=!0)},t}(l),N=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){var n=this;this.o=this.params.map((function(t){return x(t,null,n.options)}))},t.prototype.reset=function(){this.done=!1,this.keep=!1;for(var n=0,t=this.o.length;n<t;n++)this.o[n].reset()},t.prototype.next=function(n,t,r){for(var i=!1,u=!1,e=0,o=this.o.length;e<o;e++){var f=this.o[e];if(f.next(n,t,r),f.keep){i=!0,u=f.keep;break}}this.keep=u,this.done=i},t}(l),S=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.next=function(t,r,i){n.prototype.next.call(this,t,r,i),this.keep=!this.keep},t}(N),q=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.init=function(){var n=this;this.h=this.params.map((function(t){if(m(t))throw new Error("cannot nest $ under "+n.constructor.name.toLowerCase());return $(t,n.options.compare)}))},t.prototype.next=function(n,t,r){for(var i=!1,u=!1,e=0,o=this.h.length;e<o;e++){if((0,this.h[e])(n)){i=!0,u=!0;break}}this.keep=u,this.done=i},t}(l),C=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.next=function(t,r,i){n.prototype.next.call(this,t,r,i),this.keep=!this.keep},t}(q),D=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return r(t,n),t.prototype.next=function(n,t,r){r.hasOwnProperty(t)===this.params&&(this.done=!0,this.keep=!0)},t}(l),M=function(n){function t(t,r,i,u){return n.call(this,t,r,i,t.map((function(n){return x(n,r,i)})),u)||this}return r(t,n),t.prototype.next=function(n,t,r){this.childrenNext(n,t,r)},t}(w),P=function(n,t,r){return new y(n,t,r)},R=function(n,t,r,i){return new A(n,t,r,i)},T=function(n,t,r,i){return new N(n,t,r,i)},I=function(n,t,r,i){return new S(n,t,r,i)},U=function(n,t,r,i){return new k(n,t,r,i)},B=function(n,t,r,i){return new C(n,t,r,i)},G=function(n,t,r,i){return new q(n,t,r,i)},H=j((function(n){return function(t){return t<n}})),J=j((function(n){return function(t){return t<=n}})),K=j((function(n){return function(t){return t>n}})),L=j((function(n){return function(t){return t>=n}})),Q=function(n,t,r){var i=n[0],u=n[1];return new y((function(n){return e(n)%i===u}),t,r)},V=function(n,t,r,i){return new D(n,t,r,i)},W=function(n,t,r){return new y(new RegExp(n,t.$options),t,r)},X=function(n,t,r,i){return new z(n,t,r,i)},Y={number:function(n){return"number"==typeof n},string:function(n){return"string"==typeof n},bool:function(n){return"boolean"==typeof n},array:function(n){return Array.isArray(n)},null:function(n){return null===n},timestamp:function(n){return n instanceof Date}},Z=function(n,t,r){return new y((function(t){if("string"==typeof n){if(!Y[n])throw new Error("Type alias does not exist");return Y[n](t)}return null!=t&&(t instanceof n||t.constructor===n)}),t,r)},nn=function(n,t,r,i){return new M(n,t,r,i)},tn=nn,rn=function(n,t,r){return new F(n,t,r,"$size")},un=function(){return null},en=function(n,t,r){var i;if(c(n))i=n;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');i=new Function("obj","return "+n)}return new y((function(n){return i.bind(n)(n)}),t,r)},on=Object.freeze({__proto__:null,$Size:F,$eq:P,$ne:R,$or:T,$nor:I,$elemMatch:U,$nin:B,$in:G,$lt:H,$lte:J,$gt:K,$gte:L,$mod:Q,$exists:V,$regex:W,$not:X,$type:Z,$and:nn,$all:tn,$size:rn,$options:un,$where:en}),fn=function(n,t,r){var i=void 0===r?{}:r,u=i.compare,e=i.operations;return x(n,t,{compare:u,operations:Object.assign({},on,e||{})})};n.$Size=F,n.$all=tn,n.$and=nn,n.$elemMatch=U,n.$eq=P,n.$exists=V,n.$gt=K,n.$gte=L,n.$in=G,n.$lt=H,n.$lte=J,n.$mod=Q,n.$ne=R,n.$nin=B,n.$nor=I,n.$not=X,n.$options=un,n.$or=T,n.$regex=W,n.$size=rn,n.$type=Z,n.$where=en,n.EqualsOperation=y,n.createDefaultQueryOperation=fn,n.createEqualsOperation=function(n,t,r){return new y(n,t,r)},n.createOperationTester=E,n.createQueryOperation=x,n.createQueryTester=function(n,t){return void 0===t&&(t={}),E(x(n,null,t))},n.default=function(n,t){void 0===t&&(t={});var r=fn(n,null,t);return E(r)},Object.defineProperty(n,"l",{value:!0})}));
***************************************************************************** */var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,r)};function r(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i=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=i("Array"),f=i("Object"),c=i("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 r=0,i=n.length;r<i;r++)if(!s(n[r],t[r]))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,r,i,u,e){var f=t[i];if(o(n)&&isNaN(Number(f)))for(var c=0,s=n.length;c<s;c++)if(!h(n[c],t,r,i,c,n))return!1;return i===t.length||null==n?r(n,u,e):h(n[f],t,r,i+1,f,n)},a=function(){function n(n,t,r){this.params=n,this.owneryQuery=t,this.options=r,this.init()}return n.prototype.init=function(){},n.prototype.reset=function(){this.done=!1,this.keep=!1},n}(),l=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i)||this;return e.name=u,e}return r(t,n),t}(a),v=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i)||this;return e.children=u,e}return r(t,n),t.prototype.reset=function(){this.keep=!1,this.done=!1;for(var n=0,t=this.children.length;n<t;n++)this.children[n].reset()},t.prototype.childrenNext=function(n,t,r){for(var i=!0,u=!0,e=0,o=this.children.length;e<o;e++){var f=this.children[e];if(f.next(n,t,r),f.keep||(u=!1),f.done){if(!f.keep)break}else i=!1}this.done=i,this.keep=u},t}(a),w=function(n){function t(t,r,i,u,e){var o=n.call(this,t,r,i,u)||this;return o.name=e,o}return r(t,n),t}(v),p=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.next=function(n,t,r){this.childrenNext(n,t,r)},t}(v),b=function(n){function t(t,r,i,u,e){var o=n.call(this,r,i,u,e)||this;return o.keyPath=t,o.propop=!0,o.t=function(n,t,r){return o.childrenNext(n,t,r),!o.done},o}return r(t,n),t.prototype.next=function(n,t,r){h(n,this.keyPath,this.t,0,t,r)},t}(v),$=function(n,t){if(n instanceof Function)return n;if(n instanceof RegExp)return function(t){var r="string"==typeof t&&n.test(t);return n.lastIndex=0,r};var r=e(n);return function(n){return t(r,e(n))}},y=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){this.i=$(this.params,this.options.compare)},t.prototype.next=function(n,t,r){Array.isArray(r)&&!r.hasOwnProperty(t)||this.i(n,t,r)&&(this.done=!0,this.keep=!0)},t}(a),d=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.next=function(){this.done=!0,this.keep=!1},t}(a),j=function(n){return t=function(t,r,i){var u=typeof e(t),o=n(t);return new y((function(n){return typeof e(n)===u&&o(n)}),r,i)},function(n,r,i,u){return null==n?new d(n,r,i):t(n,r,i,u)};var t},O=function(n,t,r,i){var u=i.operations[n];if(!u)throw new Error("Unsupported operation: "+n);return u(t,r,i,n)},m=function(n){for(var t in n)if("$"===t.charAt(0))return!0;return!1},g=function(n,t,r,i,u){if(m(t)){var e=_(t,r,u),o=e[0];if(e[1].length)throw new Error("Property queries must contain only operations, or exact objects.");return new b(n,t,i,u,o)}return new b(n,t,i,u,[new y(t,i,u)])},x=function(n,t,r){void 0===t&&(t=null);var i=void 0===r?{}:r,u=i.compare,e=i.operations,o={compare:u||s,operations:Object.assign({},e||{})},f=_(n,null,o),c=f[0],h=f[1],a=[];return c.length&&a.push(new b([],n,t,o,c)),a.push.apply(a,h),1===a.length?a[0]:new p(n,t,o,a)},_=function(n,t,r){var i,u=[],e=[];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 u.push(new y(n,n,r)),[u,e];for(var o in n)if("$"===o.charAt(0)){var f=O(o,n[o],n,r);if(f&&!f.propop&&t&&"$"!==t.charAt(0))throw new Error("Malformed query. "+o+" cannot be matched against property.");null!=f&&u.push(f)}else e.push(g(o.split("."),n[o],o,n,r));return[u,e]},E=function(n){return function(t,r,i){return n.reset(),n.next(t,r,i),n.keep}},A=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){this.i=$(this.params,this.options.compare)},t.prototype.reset=function(){n.prototype.reset.call(this),this.keep=!0},t.prototype.next=function(n){this.i(n)&&(this.done=!0,this.keep=!1)},t}(l),k=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){this.u=x(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){n.prototype.reset.call(this),this.u.reset()},t.prototype.next=function(n){if(o(n)){for(var t=0,r=n.length;t<r;t++){this.u.reset();var i=n[t];i&&"object"==typeof i&&(this.u.next(i,t,n),this.keep=this.keep||this.u.keep)}this.done=!0}else this.done=!1,this.keep=!1},t}(l),q=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){this.u=x(this.params,this.owneryQuery,this.options)},t.prototype.reset=function(){this.u.reset()},t.prototype.next=function(n,t,r){this.u.next(n,t,r),this.done=this.u.done,this.keep=!this.u.keep},t}(l),z=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){},t.prototype.next=function(n){o(n)&&n.length===this.params&&(this.done=!0,this.keep=!0)},t}(l),F=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!1,t}return r(t,n),t.prototype.init=function(){var n=this;this.o=this.params.map((function(t){return x(t,null,n.options)}))},t.prototype.reset=function(){this.done=!1,this.keep=!1;for(var n=0,t=this.o.length;n<t;n++)this.o[n].reset()},t.prototype.next=function(n,t,r){for(var i=!1,u=!1,e=0,o=this.o.length;e<o;e++){var f=this.o[e];if(f.next(n,t,r),f.keep){i=!0,u=f.keep;break}}this.keep=u,this.done=i},t}(l),M=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!1,t}return r(t,n),t.prototype.next=function(t,r,i){n.prototype.next.call(this,t,r,i),this.keep=!this.keep},t}(F),N=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.init=function(){var n=this;this.h=this.params.map((function(t){if(m(t))throw new Error("cannot nest $ under "+n.constructor.name.toLowerCase());return $(t,n.options.compare)}))},t.prototype.next=function(n,t,r){for(var i=!1,u=!1,e=0,o=this.h.length;e<o;e++){if((0,this.h[e])(n)){i=!0,u=!0;break}}this.keep=u,this.done=i},t}(l),S=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.next=function(t,r,i){n.prototype.next.call(this,t,r,i),this.keep=!this.keep},t}(N),C=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.propop=!0,t}return r(t,n),t.prototype.next=function(n,t,r){r.hasOwnProperty(t)===this.params&&(this.done=!0,this.keep=!0)},t}(l),D=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i,t.map((function(n){return x(n,r,i)})),u)||this;return e.propop=!1,e}return r(t,n),t.prototype.next=function(n,t,r){this.childrenNext(n,t,r)},t}(w),P=function(n){function t(t,r,i,u){var e=n.call(this,t,r,i,t.map((function(n){return x(n,r,i)})),u)||this;return e.propop=!0,e}return r(t,n),t.prototype.next=function(n,t,r){this.childrenNext(n,t,r)},t}(w),R=function(n,t,r){return new y(n,t,r)},T=function(n,t,r,i){return new A(n,t,r,i)},I=function(n,t,r,i){return new F(n,t,r,i)},U=function(n,t,r,i){return new M(n,t,r,i)},B=function(n,t,r,i){return new k(n,t,r,i)},G=function(n,t,r,i){return new S(n,t,r,i)},H=function(n,t,r,i){return new N(n,t,r,i)},J=j((function(n){return function(t){return t<n}})),K=j((function(n){return function(t){return t<=n}})),L=j((function(n){return function(t){return t>n}})),Q=j((function(n){return function(t){return t>=n}})),V=function(n,t,r){var i=n[0],u=n[1];return new y((function(n){return e(n)%i===u}),t,r)},W=function(n,t,r,i){return new C(n,t,r,i)},X=function(n,t,r){return new y(new RegExp(n,t.$options),t,r)},Y=function(n,t,r,i){return new q(n,t,r,i)},Z={number:function(n){return"number"==typeof n},string:function(n){return"string"==typeof n},bool:function(n){return"boolean"==typeof n},array:function(n){return Array.isArray(n)},null:function(n){return null===n},timestamp:function(n){return n instanceof Date}},nn=function(n,t,r){return new y((function(t){if("string"==typeof n){if(!Z[n])throw new Error("Type alias does not exist");return Z[n](t)}return null!=t&&(t instanceof n||t.constructor===n)}),t,r)},tn=function(n,t,r,i){return new D(n,t,r,i)},rn=function(n,t,r,i){return new P(n,t,r,i)},un=function(n,t,r){return new z(n,t,r,"$size")},en=function(){return null},on=function(n,t,r){var i;if(c(n))i=n;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');i=new Function("obj","return "+n)}return new y((function(n){return i.bind(n)(n)}),t,r)},fn=Object.freeze({__proto__:null,$Size:z,$eq:R,$ne:T,$or:I,$nor:U,$elemMatch:B,$nin:G,$in:H,$lt:J,$lte:K,$gt:L,$gte:Q,$mod:V,$exists:W,$regex:X,$not:Y,$type:nn,$and:tn,$all:rn,$size:un,$options:en,$where:on}),cn=function(n,t,r){var i=void 0===r?{}:r,u=i.compare,e=i.operations;return x(n,t,{compare:u,operations:Object.assign({},fn,e||{})})};n.$Size=z,n.$all=rn,n.$and=tn,n.$elemMatch=B,n.$eq=R,n.$exists=W,n.$gt=L,n.$gte=Q,n.$in=H,n.$lt=J,n.$lte=K,n.$mod=V,n.$ne=T,n.$nin=G,n.$nor=U,n.$not=Y,n.$options=en,n.$or=I,n.$regex=X,n.$size=un,n.$type=nn,n.$where=on,n.EqualsOperation=y,n.createDefaultQueryOperation=cn,n.createEqualsOperation=function(n,t,r){return new y(n,t,r)},n.createOperationTester=E,n.createQueryOperation=x,n.createQueryTester=function(n,t){return void 0===t&&(t={}),E(x(n,null,t))},n.default=function(n,t){void 0===t&&(t={});var r=cn(n,null,t);return E(r)},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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc