I want to use the custom format function, but it doesn't call if the data has a number type.
example:
var validate = validator({
type: 'array',
items: [{ $id:'/0/0', format: 'uint' }] ,
maxItems: 1,
minItems: 1
}, {
includeErrors: true,
formats: {
'uint': (d) => {
console.log('validator works')
return d>0
}
},
});
console.log(validate([-2])); // true - formator uint doesn't call
console.log(validate(['-2'])); // false - formator uint calls
Expect behavior:
Formats works for numbers and any other types
I want to use the custom format function, but it doesn't call if the data has a number type.
example:
Expect behavior:
Formats works for numbers and any other types