We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e7b59c9 + 4caa259 commit 7cbc328Copy full SHA for 7cbc328
lib/validator.js
@@ -244,6 +244,8 @@ class Validator {
244
keySplit.map((item) => {
245
if (typeof value === 'undefined') {
246
value = this.inputs[item];
247
+ } else if (!value) {
248
+ return value;
249
} else {
250
value = value[item];
251
}
test/edge.js
@@ -28,7 +28,10 @@ describe('Edge Cases', () => {
28
});
29
30
it('should reject null and required fields', async () => {
31
- const v = new Validator({ field: null }, { field: 'required|string' });
+ const v = new Validator({ field: null }, {
32
+ field: 'required|object',
33
+ 'field.id': 'required|string'
34
+ });
35
36
const matched = await v.check();
37
assert.equal(matched, false);
0 commit comments