@@ -20,9 +20,9 @@ v.add("even", function({ schema, messages }, path, context) {
2020} ) ;
2121
2222const schema = {
23- id : "number|positive|integer|convert" ,
24- name : "string|min: 3|max: 255|padStart: 5" ,
25- token : "forbidden|remove" ,
23+ // id: "number|positive|integer|convert",
24+ // name: "string|min: 3|max: 255|padStart: 5",
25+ // token: "forbidden|remove",
2626 //password: { type: "string", min: 6 },
2727 //confirmPassword: { type: "equal", field: "password" },
2828 //roles: { type: "array", items: "string", min: 1, default: ["user"] },
@@ -59,7 +59,8 @@ const schema = {
5959 weightMin: "The '${field}' must be greater than {expected}! Actual: {actual}"
6060 }
6161 }*/
62- num : { type : "even" }
62+ includes : { type : "multi" , optional : true , rules : [ { type : "string" } , { type : "array" , items : "string" } ] } ,
63+ //num: { type: "even" }
6364} ;
6465
6566const check = v . compile ( schema ) ;
@@ -90,6 +91,9 @@ const obj = {
9091
9192 createdAt : Date . now ( ) ,
9293
94+ //includes: "test1",
95+ //includes: ["test1", "test2"],
96+
9397 weight : 10 ,
9498 num : 2
9599} ;
0 commit comments