feat: contains condition op

This commit is contained in:
cha0s 2019-05-28 16:51:05 -05:00
parent 121f783d7e
commit 571b498658

View File

@ -65,6 +65,14 @@ export class Condition {
}
return true;
case 'contains':
if (this.operands.length < 2) {
return false;
}
const haystack = this.operands[0].get(context);
const needle = this.operands[1].get(context);
return -1 !== haystack.indexOf(needle);
}
}