From ceeb83f5ef6324d60a2431cb7c6520eeb56cd403 Mon Sep 17 00:00:00 2001 From: Yansong Date: Mon, 24 Aug 2020 20:41:20 -0500 Subject: [PATCH] add "notContains" operator --- Sources/SwiftRulesEngine/ConditionEvaluator.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SwiftRulesEngine/ConditionEvaluator.swift b/Sources/SwiftRulesEngine/ConditionEvaluator.swift index 12c3769..210dd03 100644 --- a/Sources/SwiftRulesEngine/ConditionEvaluator.swift +++ b/Sources/SwiftRulesEngine/ConditionEvaluator.swift @@ -89,6 +89,7 @@ public extension ConditionEvaluator { addComparisonOperator(operation: "startsWith", type: String.self, closure: { $0.starts(with: $1) }) addComparisonOperator(operation: "endsWith", type: String.self, closure: { $0.hasSuffix($1) }) addComparisonOperator(operation: "contains", type: String.self, closure: { $0.contains($1) }) + addComparisonOperator(operation: "notContains", type: String.self, closure: { !$0.contains($1) }) addComparisonOperator(operation: "greaterThan", type: Int.self, closure: >) addComparisonOperator(operation: "greaterThan", type: Double.self, closure: >)