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 13.0.0 to 13.0.2

es5m/core.js.map

3

es5m/core.js

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

};
var containsOperation = function (query) {
export var containsOperation = function (query) {
for (var key in query) {

@@ -256,1 +256,2 @@ if (key.charAt(0) === "$")

};
//# sourceMappingURL=core.js.map

@@ -13,1 +13,2 @@ import * as defaultOperations from "./operations";

export default createDefaultQueryTester;
//# sourceMappingURL=index.js.map

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

})();
import { BaseOperation, EqualsOperation, createTester, createQueryOperation, GroupOperation, numericalOperation } from "./core";
import { BaseOperation, EqualsOperation, createTester, createQueryOperation, GroupOperation, numericalOperation, containsOperation } from "./core";
import { comparable, isFunction, isArray } from "./utils";

@@ -127,2 +127,43 @@ var $Ne = /** @class */ (function (_super) {

}($Or));
var $In = /** @class */ (function (_super) {
__extends($In, _super);
function $In() {
return _super !== null && _super.apply(this, arguments) || this;
}
$In.prototype.init = function () {
var _this = this;
this._testers = this.params.map(function (value) {
if (containsOperation(value)) {
throw new Error("cannot nest $ under " + _this.constructor.name.toLowerCase());
}
return createTester(value, _this.options.compare);
});
};
$In.prototype.next = function (item, key, owner) {
var done = false;
var success = false;
for (var i = 0, length_3 = this._testers.length; i < length_3; i++) {
var test = this._testers[i];
if (test(item)) {
done = true;
success = true;
break;
}
}
this.success = success;
this.done = done;
};
return $In;
}(BaseOperation));
var $Nin = /** @class */ (function (_super) {
__extends($Nin, _super);
function $Nin() {
return _super !== null && _super.apply(this, arguments) || this;
}
$Nin.prototype.next = function (item, key, owner) {
_super.prototype.next.call(this, item, key, owner);
this.success = !this.success;
};
return $Nin;
}($In));
var $Exists = /** @class */ (function (_super) {

@@ -167,6 +208,6 @@ __extends($Exists, _super);

export var $nin = function (params, owneryQuery, options) {
return new $Nor(params, owneryQuery, options);
return new $Nin(params, owneryQuery, options);
};
export var $in = function (params, owneryQuery, options) {
return new $Or(params, owneryQuery, options);
return new $In(params, owneryQuery, options);
};

@@ -212,1 +253,2 @@ export var $lt = numericalOperation(function (params) { return function (b) { return b < params; }; });

};
//# sourceMappingURL=operations.js.map

@@ -63,1 +63,2 @@ export var typeChecker = function (type) {

};
//# sourceMappingURL=utils.js.map

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

export declare const createQueryOperation: (query: any, owneryQuery: any, options: Options) => any;
export declare const createQueryTester: <TItem>(query: Query, { compare, operations }?: Partial<Options>) => (item: TItem, key?: string | number, owner?: any) => any;
export declare const createQueryTester: <TItem>(query: Query, { compare, operations }?: Partial<Options>) => (item: TItem, key?: Key, owner?: any) => any;
import { Query, Options, createQueryTester, EqualsOperation, createEqualsOperation } from "./core";
declare const createDefaultQueryTester: <TItem>(query: Query, { compare, operations }?: Partial<Options>) => (item: TItem, key?: string | number, owner?: any) => any;
declare const createDefaultQueryTester: <TItem>(query: Query, { compare, operations }?: Partial<Options>) => (item: TItem, key?: import("./utils").Key, owner?: any) => any;
export { Query, EqualsOperation, createQueryTester, createEqualsOperation };
export * from "./operations";
export default createDefaultQueryTester;

@@ -66,3 +66,3 @@ import { BaseOperation, EqualsOperation, Options, Operation, Query, GroupOperation } from "./core";

export declare const $options: () => any;
export declare const $where: (params: TimerHandler, ownerQuery: Query, options: Options) => EqualsOperation<(b: any) => any>;
export declare const $where: (params: string | Function, ownerQuery: Query, options: Options) => EqualsOperation<(b: any) => any>;
export {};
{
"name": "sift",
"description": "MongoDB query filtering in JavaScript",
"version": "13.0.0",
"version": "13.0.2",
"repository": "crcn/sift.js",

@@ -13,9 +13,2 @@ "sideEffects": false,

"engines": {},
"dependencies": {
"@rollup/plugin-typescript": "^4.1.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-sourcemaps": "^0.5.0",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-typescript2": "^0.27.0"
},
"typings": "./index.d.ts",

@@ -28,5 +21,2 @@ "husky": {

"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/register": "^7.8.3",
"@types/node": "^13.7.0",

@@ -43,8 +33,15 @@ "bson": "^4.0.3",

"ts-loader": "^6.2.1",
"typescript": "^3.8.3"
"typescript": "^3.8.3",
"@rollup/plugin-typescript": "^4.1.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-sourcemaps": "^0.5.0",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-typescript2": "^0.27.0"
},
"main": "./index.js",
"module": "./es5m/index.js",
"scripts": {
"build": "npm run build:lib && npm run build:min",
"build": "npm run build:lib && npm run build:lib:es5 && npm run build:min",
"build:lib": "tsc",
"build:lib:es5": "tsc --build tsconfig.es5.json",
"build:min": "rollup --config",

@@ -51,0 +48,0 @@ "build:watch": "tsc --watch",

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