Comparing version 13.1.4 to 13.1.5
@@ -10,6 +10,5 @@ import { Key, Comparator } from "./utils"; | ||
export declare type OperationCreator = (params: any, parentQuery: any, options: Options) => Operation; | ||
declare type ValueQuery<TValue> = { | ||
declare type NestedValueQuery<TValue> = { | ||
$eq?: TValue; | ||
$ne?: TValue; | ||
$elemMatch?: Query<TValue>; | ||
$lt?: TValue; | ||
@@ -29,7 +28,11 @@ $gt?: TValue; | ||
}; | ||
declare type RootValueQuery<TValue> = { | ||
$elemMatch?: Query<TValue, true>; | ||
} & NestedValueQuery<TValue>; | ||
declare type ValueQuery<TValue, nested> = nested extends true ? NestedValueQuery<TValue> : RootValueQuery<TValue>; | ||
declare type NotObject = string | number | Date | boolean | Array<any>; | ||
declare type ShapeQuery<TItemSchema> = TItemSchema extends NotObject ? {} : { | ||
[k in keyof TItemSchema]?: TItemSchema[k] | Query<TItemSchema[k]>; | ||
declare type ShapeQuery<TItemSchema, nested> = TItemSchema extends NotObject ? {} : { | ||
[k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery<TItemSchema[k], nested>; | ||
}; | ||
export declare type Query<TItemSchema> = ValueQuery<TItemSchema> & ShapeQuery<TItemSchema>; | ||
export declare type Query<TItemSchema, nested = false> = ValueQuery<TItemSchema, nested> & ShapeQuery<TItemSchema, nested>; | ||
export declare abstract class BaseOperation<TParams> implements Operation { | ||
@@ -94,3 +97,3 @@ readonly params: TParams; | ||
export declare const createQueryOperation: (query: any, owneryQuery: any, options: Options) => any; | ||
export declare const createQueryTester: <TItem, TSchema = TItem>(query: Query<TSchema>, { compare, operations }?: Partial<Options>) => (item: TItem, key?: Key, owner?: any) => any; | ||
export declare const createQueryTester: <TItem, TSchema = TItem>(query: Query<TSchema, false>, { compare, operations }?: Partial<Options>) => (item: TItem, key?: Key, owner?: any) => any; | ||
export {}; |
import { Query, Options, createQueryTester, EqualsOperation, createEqualsOperation } from "./core"; | ||
declare const createDefaultQueryTester: <TItem, TSchema extends TItem = TItem>(query: Query<TSchema>, { compare, operations }?: Partial<Options>) => (item: TItem, key?: string | number, owner?: any) => any; | ||
declare const createDefaultQueryTester: <TItem, TSchema extends TItem = TItem>(query: Query<TSchema, false>, { compare, operations }?: Partial<Options>) => (item: TItem, key?: string | number, owner?: any) => any; | ||
export { Query, EqualsOperation, createQueryTester, createEqualsOperation }; | ||
export * from "./operations"; | ||
export default createDefaultQueryTester; |
{ | ||
"name": "sift", | ||
"description": "MongoDB query filtering in JavaScript", | ||
"version": "13.1.4", | ||
"version": "13.1.5", | ||
"repository": "crcn/sift.js", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
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
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
247255
2567