cpr.expression.Expression
A class that uses expressions.
Index
| Name |
Type |
Description |
| src |
#expression |
Source to compile |
| Name |
Return Type |
Description |
| and |
ComposedExpression |
This expression and other expressions are combined with an AND condition to obtain an expression. |
| asComparator |
(a: Object, b: Object)=>Number |
Compare expression values. |
| asFilter |
(e: Object)=>Boolean |
Returns an expression as a filter. |
| asMapper |
(e: Object)=>Object |
Returns the expression as a mapper. |
| evaluate |
Object |
Returns the evaluation result of the compiled function at the source. |
| evaluateAll |
Array |
Returns the result of evaluating all compiled functions in the source. |
| evaluateFirst |
Object |
Only the first of the compiled functions in the source returns the evaluation result. |
| hasSyntaxError |
Boolean |
|
| or |
ComposedExpression |
Specifies CompositionExpression by specifying multiple expressions. |
Constructor
Creates a new expression object.
| name |
type |
description |
| src
|
#expression | Function |
expression string. |
Properties
| type
|
#expression |
| get
|
Source to compile
|
| set
|
Set the source to be compiled.
|
Methods
This expression and other expressions are combined with an AND condition to obtain an expression.
Compare expression values.
| return
|
(a: Object, b: Object)=>Number |
|
Returns an expression as a filter.
| return
|
(e: Object)=>Boolean |
|
Returns the expression as a mapper.
| return
|
(e: Object)=>Object |
|
Returns the evaluation result of the compiled function at the source. Returns array or object.
| name |
type |
description |
| self
|
Object |
|
Returns the result of evaluating all compiled functions in the source.
| name |
type |
description |
| self
|
Object |
|
Only the first of the compiled functions in the source returns the evaluation result.
| name |
type |
description |
| self
|
Object |
|
Specifies CompositionExpression by specifying multiple expressions. Through the returned ComposedExpression, one of the two filters can be checked to see if one of the expressions is correct.