You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when a predicate is failed by returning a message the type is pre-pended to the message like so:
constgreaterThan=(max: number,x: number)=>{returnx>max||`Expected \`${x}\` to be greater than \`${max}\``;};ow(5,ow.number.is(x=>greaterThan(10,x)));// => ArgumentError: (number) Expected `5` to be greater than `10`
and if a custom label is added:
ow(5,'custom label',ow.number.is(x=>greaterThan(10,x)));// => ArgumentError: (number `custom label`) Expected `5` to be greater than `10`
I would love the option to override/remove as I want to send this error message back to the client and having the type there would be context leak e.g. the client has no need to know backend type implementations.
The text was updated successfully, but these errors were encountered:
Currently when a predicate is failed by returning a message the type is pre-pended to the message like so:
and if a custom label is added:
I would love the option to override/remove as I want to send this error message back to the client and having the type there would be context leak e.g. the client has no need to know backend type implementations.
The text was updated successfully, but these errors were encountered: