node-input-validator icon indicating copy to clipboard operation
node-input-validator copied to clipboard

"required" don't works with empty arrays

Open peter-peter-22 opened this issue 1 year ago • 0 comments

The required condition thinks empty arrays don't exist and sends a "the * field is mandatory" error. Is there any way to require an array that can be empty?

Reproducing the error:

async function a() { const v = new Validator( { test: [] }, { test: 'required' } ); const matched = await v.check(); console.log(matched); }

peter-peter-22 avatar Apr 25 '24 01:04 peter-peter-22