Skip to content

Commit

Permalink
Dependency updates (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
srcmayte authored May 15, 2024
1 parent 29be5ff commit 92ffea8
Show file tree
Hide file tree
Showing 4 changed files with 6,890 additions and 986 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ const rule = {
}
```

### Boolean expressions: `all` and `any`
Each rule's conditions must have either an `all` or an `any` operator at its root, containing an array of conditions. The `all` operator specifies that all conditions contained within must be truthy for the rule to be considered a `success`. The `any` operator only requires one condition to be truthy for the rule to succeed.
### Boolean expressions: `all`, `any` and `not`
Each rule's conditions must have either an `all`, `any` or a `not` operator at its root, containing an array of conditions.

- The `all` operator specifies that all conditions contained within must be truthy for the rule to be considered a `success`.
- The `any` operator only requires one condition to be truthy for the rule to succeed. The
- The `not` operator requires a condition.

Boolean conditions can be nested within one another to produce complex boolean expressions.

Expand All @@ -179,7 +183,8 @@ const nestedBoolean = {
{
all: [ /* more conditions */ ]
}
]
],
not: { /* condition */ }
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion lib/strategyEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class StrategyEngine {
}

async #resolveRule (rule, almanac) {
const conditionKeys = ['all', 'any']
const conditionKeys = ['all', 'any', 'not']
const resolvedRule = _.cloneDeep(rule)

const promises = []
Expand Down
Loading

0 comments on commit 92ffea8

Please sign in to comment.