import { createValidator, getCurrentPath } from '../core'; export function test(isValid: (value: any) => boolean, message: string) { return createValidator({ validate: (value, ctx) => (isValid(value) ? null : { message, path: getCurrentPath(ctx), children: null }), }); }