github
1388 of 2837 branches covered (48.92%)
25 of 1927 new or added lines in 39 files covered. (1.3%)
1 existing line in 1 file now uncovered.14099 of 81259 relevant lines covered (17.35%)
1.72 hits per line
NEW
|
import { noop } from 'lodash'; |
|
NEW
|
import { createContext } from 'react'; |
× |
NEW
|
import type { QuerySortedKeys } from '../constant'; |
× |
NEW
|
|
× |
NEW
|
export type IQueryValidatorKey = (typeof QuerySortedKeys)[number];
|
× |
NEW
|
|
× |
NEW
|
export interface IQueryFormContext {
|
× |
NEW
|
validators: Record<IQueryValidatorKey, (() => boolean) | undefined>;
|
× |
NEW
|
registerValidator: (key: IQueryValidatorKey, fn?: () => boolean) => void; |
× |
NEW
|
} |
× |
NEW
|
|
× |
NEW
|
export const QueryFormContext = createContext<IQueryFormContext>({ |
× |
NEW
|
validators: {
|
× |
NEW
|
join: undefined,
|
× |
NEW
|
select: undefined, |
× |
NEW
|
groupBy: undefined, |
× |
NEW
|
orderBy: undefined, |
× |
NEW
|
where: undefined, |
× |
NEW
|
limit: undefined, |
× |
NEW
|
offset: undefined, |
× |
NEW
|
aggregation: undefined, |
× |
NEW
|
}, |
× |
NEW
|
registerValidator: noop,
|
× |
NEW
|
}); |
× |