diff --git a/packages/behavior/item/condition.js b/packages/behavior/item/condition.js index 7b5fe0c..bf10d87 100644 --- a/packages/behavior/item/condition.js +++ b/packages/behavior/item/condition.js @@ -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); + } }