@feathersjs/adapter-commons
Version:
Shared database adapter utility functions
29 lines (28 loc) • 1.19 kB
TypeScript
import { Query } from '@feathersjs/feathers';
import { FilterQueryOptions, FilterSettings, PaginationParams } from './declarations';
/**
* Returns the converted `$limit` value based on the `paginate` configuration.
* @param _limit The limit value
* @param paginate The pagination options
* @returns The converted $limit value
*/
export declare const getLimit: (_limit: any, paginate?: PaginationParams) => number;
export declare const OPERATORS: string[];
export declare const FILTERS: FilterSettings;
/**
* Converts Feathers special query parameters and pagination settings
* and returns them separately as `filters` and the rest of the query
* as `query`. `options` also gets passed the pagination settings and
* a list of additional `operators` to allow when querying properties.
*
* @param query The initial query
* @param options Options for filtering the query
* @returns An object with `query` which contains the query without `filters`
* and `filters` which contains the converted values for each filter.
*/
export declare function filterQuery(_query: Query, options?: FilterQueryOptions): {
filters: {
[key: string]: any;
};
query: Query;
};