Skip to content

Commit

Permalink
fix evaluation-js for empty evaluation result
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed Apr 20, 2022
1 parent e44af95 commit 527916a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion evaluation-js/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("org.jlleitschuh.gradle.ktlint") version Versions.kotlinLint
}

version = "0.0.3"
version = "0.0.4"

kotlin {

Expand Down
3 changes: 3 additions & 0 deletions evaluation-js/src/jsMain/kotlin/Evaluation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ fun evaluate(rules: dynamic, user: dynamic): dynamic {

// Evaluate user for flag configurations
val results = engine.evaluate(flagConfigs, skylabUser)
if (results.isEmpty()) {
return JSON.parse("{}")
}

// Build JSON Output
val sb = StringBuilder()
Expand Down

0 comments on commit 527916a

Please sign in to comment.