Comparing version 13.0.0 to 13.0.2
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193714
0
47
3476
17
- Removed@rollup/plugin-typescript@^4.1.1
- Removedrollup-plugin-commonjs@^10.1.0
- Removedrollup-plugin-sourcemaps@^0.5.0
- Removedrollup-plugin-terser@^5.3.0
- Removedrollup-plugin-typescript2@^0.27.0
- Removed@babel/code-frame@7.24.7(transitive)
- Removed@babel/helper-validator-identifier@7.24.7(transitive)
- Removed@babel/highlight@7.24.7(transitive)
- Removed@rollup/plugin-typescript@4.1.2(transitive)
- Removed@rollup/pluginutils@3.1.0(transitive)
- Removed@types/estree@0.0.39(transitive)
- Removed@types/node@22.7.4(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedatob@2.1.2(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommondir@1.0.1(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedestree-walker@0.6.11.0.1(transitive)
- Removedfind-cache-dir@3.3.2(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-reference@1.2.1(transitive)
- Removedjest-worker@24.9.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedmagic-string@0.25.9(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedmerge-stream@2.0.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpicocolors@1.1.0(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpkg-dir@4.2.0(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedresolve@1.17.01.22.8(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedrollup@2.79.2(transitive)
- Removedrollup-plugin-commonjs@10.1.0(transitive)
- Removedrollup-plugin-sourcemaps@0.5.0(transitive)
- Removedrollup-plugin-terser@5.3.1(transitive)
- Removedrollup-plugin-typescript2@0.27.3(transitive)
- Removedrollup-pluginutils@2.8.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@6.3.1(transitive)
- Removedserialize-javascript@4.0.0(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-support@0.5.21(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsourcemap-codec@1.4.8(transitive)
- Removedsupports-color@5.5.06.1.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedterser@4.8.1(transitive)
- Removedtslib@2.0.12.7.0(transitive)
- Removedtypescript@5.6.2(transitive)
- Removedundici-types@6.19.8(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedurix@0.1.0(transitive)