Constructor
new BooleanExpression(items, type)
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<any> | The items in the boolean expression. Each item can either be an object of an arbitrary type or a boolean expression. |
type |
string | The type of the boolean expression ('and'/'or'); |
- Source:
Methods
evaluate(options) → {boolean}
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object | The options for evaluation.
Properties
|
- Source:
Returns:
Whether the overall expression is true or false.
- Type
- boolean
isAnd() → {boolean}
- Source:
Returns:
Whether the expression is an 'and' expression.
- Type
- boolean
isOr() → {boolean}
- Source:
Returns:
Whether the expression is an 'or' expression.
- Type
- boolean
reduce(options) → {any}
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | The options for reduction.
Properties
|
- Source:
Returns:
The reduced value of the expression.
- Type
- any
simplify(options) → {BooleanExpression}
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object | The options for simplification.
Properties
|
- Source:
Returns:
The simplified boolean expression.
- Type
- BooleanExpression
(static) and(…items) → {BooleanExpression}
Constructs a new boolean expression with the 'and' type.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
items |
any |
<repeatable> |
The items in the boolean expression. Each item can either be an object of an arbitrary type or a boolean expression. |
- Source:
Returns:
The new boolean expression.
- Type
- BooleanExpression
(static) or(…items) → {BooleanExpression}
Constructs a new boolean expression with the 'or' type.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
items |
any |
<repeatable> |
The items in the boolean expression. Each item can either be an object of an arbitrary type or a boolean expression. |
- Source:
Returns:
The new boolean expression.
- Type
- BooleanExpression