hannah-password-rules
Version:
Make validations defined from dashboard of Platform
34 lines (31 loc) • 896 B
text/typescript
type Option = {
value: number | string | boolean;
required: boolean;
period?: "day" | "week" | "month";
};
interface CustomObject {
[key: string]: string | undefined;
}
interface CustomBooleanObject {
[key: string]: Function;
}
interface Validations {
words: Array<string>;
rules: {
max_length?: Option;
min_length?: Option;
mayus_quantity?: Option;
minus_quantity?: Option;
number_quantity?: Option;
special_char_quantity?: Option;
with_disallowed_words?: Option;
with_disallowed_user_name?: Option;
with_disallowed_user_email?: Option;
with_disallowed_user_phone?: Option;
};
}
declare function passwordRules(password: string, validation: Validations, props?: CustomObject): {
validations: () => CustomBooleanObject;
test: () => CustomObject;
};
export { passwordRules };