import { StringValidator as Validator, ValidationArraySchema } from '~/domain'; import { themis } from '~/main'; import { falsyValues } from '../helpers'; export const getMakeRules = (key: K) => { return (value: Validator.Rules[K] | null): Validator.Rules => { if (value !== undefined && value !== null) { return { [key]: value } as any; } return {}; }; }; export const getAnyArray = () => { return [...falsyValues, [1], [{}]]; }; export const makeSut = (rules: ValidationArraySchema.Rules) => { const sut = themis.array(rules); return { sut }; }; export * from '../helpers';