Skip to content

Commit

Permalink
keep attributeValue as Int in top
Browse files Browse the repository at this point in the history
  • Loading branch information
Tan108 committed Dec 4, 2024
1 parent 4363697 commit bdcd343
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/kotlin/com/featurevisor/sdk/Conditions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ object Conditions {
}
}

conditionValue is ConditionValue.ArrayValue -> {
val valueInContext = (context[attributeKey] as? AttributeValue.StringValue)?.value
attributeValue is AttributeValue.IntValue && conditionValue is ConditionValue.ArrayValue -> {
when (operator) {
IN_ARRAY -> valueInContext in conditionValue.values
NOT_IN_ARRAY -> valueInContext !in conditionValue.values
IN_ARRAY -> attributeValue.value.toString() in conditionValue.values
NOT_IN_ARRAY -> (attributeValue.value.toString() !in conditionValue.values)
else -> false
}
}

attributeValue is AttributeValue.IntValue && conditionValue is ConditionValue.ArrayValue -> {
conditionValue is ConditionValue.ArrayValue -> {
val valueInContext = (context[attributeKey] as? AttributeValue.StringValue)?.value
when (operator) {
IN_ARRAY -> attributeValue.value.toString() in conditionValue.values
NOT_IN_ARRAY -> (attributeValue.value.toString() !in conditionValue.values)
IN_ARRAY -> valueInContext in conditionValue.values
NOT_IN_ARRAY -> valueInContext !in conditionValue.values
else -> false
}
}
Expand Down

0 comments on commit bdcd343

Please sign in to comment.