@travetto/model
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -23,3 +23,3 @@ { | ||
}, | ||
"version": "0.0.8" | ||
"version": "0.0.9" | ||
} |
export type SortOptions = { [key: string]: number } | string | string[]; | ||
export type FieldComparableType = Date | number; | ||
export type FieldType = string | number | boolean | Date | object; | ||
export type FieldType = FieldComparableType | string | boolean; | ||
export type FieldArrayType = FieldType[]; | ||
export function isSubQuery(o: any): o is SubQuery { | ||
return o.$lt || o.$lte || o.$gt || o.$gte || o.$eq || o.$ne || o.$in || o.$nin || o.$exists; | ||
} | ||
export type Point = [number, number]; | ||
export type SubQuery = { | ||
$lt: FieldComparableType; | ||
$lte?: FieldComparableType; | ||
$gt?: FieldComparableType; | ||
$gte?: FieldComparableType; | ||
$eq?: FieldType; | ||
$ne?: FieldType; | ||
$in?: FieldArrayType; | ||
$nin?: FieldArrayType; | ||
$exists?: boolean; | ||
} | ||
export type FieldQuery = | ||
{ lt: FieldComparableType; } | | ||
{ lte: FieldComparableType; } | | ||
{ gt: FieldComparableType; } | | ||
{ gte: FieldComparableType; } | | ||
{ eq: FieldType; } | | ||
{ ne: FieldType; } | | ||
{ in: FieldArrayType; } | | ||
{ nin: FieldArrayType; } | | ||
{ all: FieldArrayType; } | | ||
{ exists: boolean; } | | ||
{ regex: RegExp; } | | ||
{ geoWithin: Point[] } | | ||
{ geoIntersects: Point[] } | | ||
FieldType; | ||
export type Query = { | ||
[key: string]: FieldType | RegExp | SubQuery; | ||
} & { | ||
$and?: Query[], | ||
$or?: Query[] | ||
}; | ||
export type Query = | ||
{ and: Query[]; } | | ||
{ or: Query[]; } | | ||
{ not: Query; } | | ||
{ [key: string]: FieldQuery; }; | ||
export interface QueryOptions { | ||
@@ -37,2 +37,4 @@ sort?: SortOptions; | ||
export type ModelId = string | number; | ||
let q: Query = { | ||
'name.first': 'orange' | ||
} |
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
20897
480