@yobta/validator
Version:
Tree-shakable es6 validator
14 lines • 788 B
TypeScript
import type { YobtaMaybe } from '../_types/YobtaMaybe.js';
import type { YobtaPretty } from '../_types/YobtaPretty.js';
import type { YobtaAnySyncRule, YobtaSyncRule } from '../rule/rule.js';
type SyncRulesRecord = Record<PropertyKey, YobtaAnySyncRule>;
type ShapeConfigYobta<Record extends SyncRulesRecord> = {
[Validator in keyof Record]: Record[Validator];
};
type ValidShapeYobta<Record extends SyncRulesRecord> = {
[Validator in keyof Record]: ReturnType<ReturnType<Record[Validator]>>;
};
export declare const shapeMessage = "Ivalid shape";
export declare const shape: <I, F extends SyncRulesRecord>(rulesMap: ShapeConfigYobta<F>, validationMessage?: string) => YobtaSyncRule<I, YobtaMaybe<I, YobtaPretty<ValidShapeYobta<F>>>>;
export {};
//# sourceMappingURL=shape.d.ts.map