@magnetarjs/core
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -6,2 +6,3 @@ import { O } from 'ts-toolbelt'; | ||
import { WhereFilterOp } from './types/clauses'; | ||
import { OPaths } from './types/helpers'; | ||
export declare type CollectionInstance<DocDataType extends Record<string, any> = Record<string, any>> = { | ||
@@ -68,11 +69,11 @@ /** | ||
*/ | ||
where: (fieldPath: string, operator: WhereFilterOp, value: any) => CollectionInstance<DocDataType>; | ||
orderBy: (fieldPath: OPaths<DocDataType, 4>, direction?: 'asc' | 'desc') => CollectionInstance<DocDataType>; | ||
/** | ||
* Chainable filter. Returns {@link CollectionInstance} with filter applied. | ||
*/ | ||
orderBy: (fieldPath: string, direction?: 'asc' | 'desc') => CollectionInstance<DocDataType>; | ||
limit: (limitCount: number) => CollectionInstance<DocDataType>; | ||
/** | ||
* Chainable filter. Returns {@link CollectionInstance} with filter applied. | ||
*/ | ||
limit: (limitCount: number) => CollectionInstance<DocDataType>; | ||
where: (fieldPath: OPaths<DocDataType, 4>, operator: WhereFilterOp, value: any) => CollectionInstance<DocDataType>; | ||
}; | ||
@@ -79,0 +80,0 @@ export declare function createCollectionWithContext<DocDataType extends Record<string, any>>([collectionPath, docId]: [string, string | undefined], moduleConfig: ModuleConfig, globalConfig: O.Compulsory<GlobalConfig>, docFn: DocFn<DocDataType>, collectionFn: CollectionFn<DocDataType>, streamAndFetchPromises: { |
{ | ||
"name": "@magnetarjs/core", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"sideEffects": false, | ||
@@ -25,3 +25,3 @@ "description": "Magnetar core library.", | ||
"devDependencies": { | ||
"@magnetarjs/test-utils": "^0.1.4", | ||
"@magnetarjs/test-utils": "^0.1.5", | ||
"ava": "^3.15.0" | ||
@@ -70,3 +70,3 @@ }, | ||
}, | ||
"gitHead": "c3fd18f4aa477813893961761ee7b9e8c360b17e" | ||
"gitHead": "215a65d0f653476a7fa5868b36e68cdd437339be" | ||
} |
@@ -17,2 +17,3 @@ import { O } from 'ts-toolbelt' | ||
import { WhereClause, WhereFilterOp, OrderByClause } from './types/clauses' | ||
import { OPaths } from './types/helpers' | ||
@@ -84,11 +85,11 @@ export type CollectionInstance<DocDataType extends Record<string, any> = Record<string, any>> = { | ||
*/ | ||
where: (fieldPath: string, operator: WhereFilterOp, value: any) => CollectionInstance<DocDataType> | ||
orderBy: (fieldPath: OPaths<DocDataType, 4>, direction?: 'asc' | 'desc') => CollectionInstance<DocDataType> | ||
/** | ||
* Chainable filter. Returns {@link CollectionInstance} with filter applied. | ||
*/ | ||
orderBy: (fieldPath: string, direction?: 'asc' | 'desc') => CollectionInstance<DocDataType> | ||
limit: (limitCount: number) => CollectionInstance<DocDataType> | ||
/** | ||
* Chainable filter. Returns {@link CollectionInstance} with filter applied. | ||
*/ | ||
limit: (limitCount: number) => CollectionInstance<DocDataType> | ||
where: (fieldPath: OPaths<DocDataType, 4>, operator: WhereFilterOp, value: any) => CollectionInstance<DocDataType> | ||
} | ||
@@ -130,3 +131,3 @@ | ||
function where( | ||
fieldPath: string, | ||
fieldPath: OPaths<DocDataType, 4>, | ||
operator: WhereFilterOp, | ||
@@ -141,3 +142,3 @@ value: any | ||
function orderBy( | ||
fieldPath: string, | ||
fieldPath: OPaths<DocDataType, 4>, | ||
direction: 'asc' | 'desc' = 'asc' | ||
@@ -144,0 +145,0 @@ ): CollectionInstance<DocDataType> { |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { O } from 'ts-toolbelt' | ||
@@ -2,0 +3,0 @@ import { isPlainObject, isFunction, isArray } from 'is-what' |
@@ -36,4 +36,4 @@ import test from 'ava' | ||
'Defense': 49, | ||
'Sp. Attack': 65, | ||
'Sp. Defense': 65, | ||
'SpAttack': 65, | ||
'SpDefense': 65, | ||
'Speed': 45, | ||
@@ -62,4 +62,4 @@ }, | ||
'Defense': 49, | ||
'Sp. Attack': 65, | ||
'Sp. Defense': 65, | ||
'SpAttack': 65, | ||
'SpDefense': 65, | ||
'Speed': 45, | ||
@@ -66,0 +66,0 @@ }, |
@@ -24,4 +24,4 @@ import test from 'ava' | ||
'Defense': 49, | ||
'Sp. Attack': 65, | ||
'Sp. Defense': 65, | ||
'SpAttack': 65, | ||
'SpDefense': 65, | ||
'Speed': 45, | ||
@@ -28,0 +28,0 @@ }, |
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
271156
65
6202