@yamamotok/dataobject
Version:
Decorator based JSON serializer and deserializer.
14 lines (13 loc) • 471 B
TypeScript
export interface Validator {
validator: ValidatorFunction;
options?: ValidatorOptions;
}
export declare type ValidatorFunction<T = any> = (value: T) => void | boolean | Error;
export declare type ValidatorFunctionS = (value: string) => void | boolean | Error;
export interface ValidatorOptions {
/**
* Validate the value as string.
* If true, the value will be coerced to string and then be validated.
*/
asString?: boolean;
}