Currently yup's validation and cast behavior for booleans seems way too greedy: https://tonicdev.com/joshuajabbour/yup-greedy-cast Even with the strict flag, the results are counter-intuitive. Ultimately, I think most people will need to overwrite the default transformer.
Personally, I think the boolean transformer should be more restrictive, and only accept true, false, 'true', 'false', 1, 0, '1', '0'. At the very least, the docs need to detail that 'whatever1' === true, etc. (All the types need transformer documentation actually.)
Currently yup's validation and cast behavior for booleans seems way too greedy: https://tonicdev.com/joshuajabbour/yup-greedy-cast Even with the
strictflag, the results are counter-intuitive. Ultimately, I think most people will need to overwrite the default transformer.Personally, I think the boolean transformer should be more restrictive, and only accept
true,false,'true','false',1,0,'1','0'. At the very least, the docs need to detail that'whatever1' === true, etc. (All the types need transformer documentation actually.)