Skip to content

Commit

Permalink
Update README.md (#326)
Browse files Browse the repository at this point in the history
- fix the typo where resultSet should be used to retrieve
- added else block

Signed-off-by: Chih-Chieh Huang <[email protected]>
  • Loading branch information
cch0 authored Jun 24, 2023
1 parent 7c5ec07 commit 9fc9e1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ loadPolicy(policyWasm).then((policy) => {
resultSet = policy.evaluate(input);
if (resultSet == null) {
console.error("evaluation error");
}
if (resultSet.length == 0) {
} else if (resultSet.length == 0) {
console.log("undefined");
} else {
console.log("allowed = " + resultSet[0].result);
}
console.log("allowed = " + allowed[0].result);
}).catch((error) => {
console.error("Failed to load policy: ", error);
});
Expand Down

0 comments on commit 9fc9e1c

Please sign in to comment.