fix: don't throw on haystack not being array
This commit is contained in:
parent
18272ceecf
commit
d204ed8ac9
|
@ -39,6 +39,9 @@ export default (latus) => (condition) => {
|
|||
return true;
|
||||
case 'contains': {
|
||||
const haystack = operands[0](context);
|
||||
if (!Array.isArray(haystack)) {
|
||||
return false;
|
||||
}
|
||||
const needle = operands[1](context);
|
||||
return -1 !== haystack.indexOf(needle);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user