main
HerrHase 2 years ago
parent f558dd123a
commit 2431dfaef5

@ -72,10 +72,7 @@ class Filter {
_in(value, key, result) {
let isValid = false
if (!result[key]) {
isValid = false
}
if (result[key]) {
if (Array.isArray(value)) {
let found = false
@ -94,6 +91,7 @@ class Filter {
isValid = true
}
}
}
return isValid
}

@ -54,6 +54,21 @@ describe('Filter', function () {
assert.equal(filter.validate(data), true)
})
it('_in single, missing tags', function() {
const filter = new Filter({
tags: {
_in: 'monday'
}
})
const data = {
name: 'monday'
}
assert.equal(filter.validate(data), false)
})
it('_in array', function() {
const filter = new Filter({

Loading…
Cancel
Save