github
1388 of 2842 branches covered (48.84%)
25 of 2297 new or added lines in 45 files covered. (1.09%)
1 existing line in 1 file now uncovered.14099 of 81628 relevant lines covered (17.27%)
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
|
}); |
× |