We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2161f6f commit 113acb3Copy full SHA for 113acb3
1 file changed
src/index.ts
@@ -49,34 +49,3 @@ export { Telefone } from "./telefone";
49
export { Cnh } from "./cnh";
50
export { Boleto } from "./boleto";
51
export { Nis } from "./nis";
52
-
53
-export const validator = (joi: any) => ({
54
- type: "document",
55
- base: joi.string(),
56
- messages: {
57
- "document.cpf": "CPF inválido",
58
- "document.cnpj": "CNPJ inválido",
59
- },
60
- rules: {
61
- cpf: {
62
- validate(value: any, helpers: any, args: any, options: any) {
63
- if (!Cpf.isValid(value)) {
64
- return helpers.error("document.cpf");
65
- }
66
67
- return value;
68
69
70
- cnpj: {
71
72
- if (!Cnpj.isValid(value)) {
73
- return helpers.error("document.cnpj");
74
75
76
77
78
79
80
-});
81
82
-export default validator;
0 commit comments