@jbrowse/jexl 2.3.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/LICENSE.txt +1 -0
- package/README.md +77 -85
- package/dist/Expression.d.ts +2 -12
- package/dist/Expression.js +5 -27
- package/dist/Expression.js.map +1 -1
- package/dist/Jexl.d.ts +6 -40
- package/dist/Jexl.js +7 -49
- package/dist/Jexl.js.map +1 -1
- package/dist/Lexer.js +3 -1
- package/dist/Lexer.js.map +1 -1
- package/dist/evaluator/Evaluator.d.ts +14 -55
- package/dist/evaluator/Evaluator.js +14 -73
- package/dist/evaluator/Evaluator.js.map +1 -1
- package/dist/evaluator/handlers.d.ts +19 -18
- package/dist/evaluator/handlers.js +54 -62
- package/dist/evaluator/handlers.js.map +1 -1
- package/dist/grammar.d.ts +3 -4
- package/dist/grammar.js +16 -39
- package/dist/grammar.js.map +1 -1
- package/dist/parser/Parser.js +16 -3
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/states.js +7 -3
- package/dist/parser/states.js.map +1 -1
- package/esm/Expression.d.ts +2 -12
- package/esm/Expression.js +5 -27
- package/esm/Expression.js.map +1 -1
- package/esm/Jexl.d.ts +6 -40
- package/esm/Jexl.js +7 -49
- package/esm/Jexl.js.map +1 -1
- package/esm/Lexer.js +3 -1
- package/esm/Lexer.js.map +1 -1
- package/esm/evaluator/Evaluator.d.ts +14 -55
- package/esm/evaluator/Evaluator.js +14 -73
- package/esm/evaluator/Evaluator.js.map +1 -1
- package/esm/evaluator/handlers.d.ts +19 -18
- package/esm/evaluator/handlers.js +54 -62
- package/esm/evaluator/handlers.js.map +1 -1
- package/esm/grammar.d.ts +3 -4
- package/esm/grammar.js +16 -39
- package/esm/grammar.js.map +1 -1
- package/esm/parser/Parser.js +16 -3
- package/esm/parser/Parser.js.map +1 -1
- package/esm/parser/states.js +7 -3
- package/esm/parser/states.js.map +1 -1
- package/package.json +10 -8
- package/src/Expression.ts +5 -36
- package/src/Jexl.ts +7 -54
- package/src/Lexer.ts +3 -1
- package/src/evaluator/Evaluator.ts +14 -92
- package/src/evaluator/handlers.ts +54 -68
- package/src/grammar.ts +17 -38
- package/src/parser/Parser.ts +13 -3
- package/src/parser/states.ts +7 -3
- package/src/types.ts +4 -1
- package/dist/PromiseSync.d.ts +0 -13
- package/dist/PromiseSync.js +0 -80
- package/dist/PromiseSync.js.map +0 -1
- package/esm/PromiseSync.d.ts +0 -13
- package/esm/PromiseSync.js +0 -78
- package/esm/PromiseSync.js.map +0 -1
- package/src/PromiseSync.ts +0 -86
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,33 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
Nothing yet!
|
|
8
8
|
|
|
9
|
+
## [v3.0.0]
|
|
10
|
+
|
|
11
|
+
### BREAKING CHANGES
|
|
12
|
+
|
|
13
|
+
- **Removed async evaluation support**: Jexl now only supports synchronous evaluation
|
|
14
|
+
- **Renamed methods**: `evalSync()` has been renamed to `eval()`. The async `eval()` method has been removed.
|
|
15
|
+
- **Removed PromiseSync class**: Internal implementation detail removed
|
|
16
|
+
- **Removed transforms**: The transform/pipe operator (`|`) has been completely removed. Use functions instead.
|
|
17
|
+
- **Removed array filtering**: Relative filter expressions (e.g., `array[.property == value]`) have been removed. Bracket notation for array/object access (e.g., `array[0]`, `object["key"]`) still works.
|
|
18
|
+
- **Removed transform methods**: `addTransform()`, `addTransforms()`, and `getTransform()` have been removed.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Simplified codebase by removing Promise/PromiseSync abstraction layer
|
|
23
|
+
- All evaluation is now synchronous, improving performance and simplifying error handling
|
|
24
|
+
- Errors are now thrown directly rather than being rejected Promises
|
|
25
|
+
- Removed pipe operator (`|`) from grammar
|
|
26
|
+
- Removed filter bracket syntax for relative filtering
|
|
27
|
+
|
|
28
|
+
### Migration Guide
|
|
29
|
+
|
|
30
|
+
- Replace `await jexl.eval(expr)` with `jexl.eval(expr)` (remove await)
|
|
31
|
+
- Replace `jexl.evalSync(expr)` with `jexl.eval(expr)` (remove Sync suffix)
|
|
32
|
+
- Replace transforms with functions: change `value|transform(arg)` to `transform(value, arg)`
|
|
33
|
+
- Remove uses of relative filtering syntax `array[.prop == value]` (note: direct indexing like `array[0]` still works)
|
|
34
|
+
- Replace `.catch()` error handling with `try/catch` blocks
|
|
35
|
+
|
|
9
36
|
## [v2.3.0]
|
|
10
37
|
|
|
11
38
|
### Added
|
package/LICENSE.txt
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# @jbrowse/jexl
|
|
2
2
|
|
|
3
|
-
A fork of the jexl lang for jbrowse
|
|
3
|
+
A fork of the TomFrost/jexl minimal expression lang for jbrowse
|
|
4
|
+
|
|
5
|
+
Major changes include
|
|
6
|
+
|
|
7
|
+
- Removing async
|
|
8
|
+
- Remove 'transforms' (use functions instead)
|
|
9
|
+
- Remove array filtering expressions
|
|
10
|
+
- Added template strings
|
|
11
|
+
- Added multiple expression evaluation
|
|
4
12
|
|
|
5
13
|
## Quick Examples
|
|
6
14
|
|
|
@@ -16,30 +24,26 @@ const context = {
|
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
// Template strings with interpolation
|
|
19
|
-
jexl.
|
|
27
|
+
jexl.eval('`Hello ${name.first} ${name.last}`', context)
|
|
20
28
|
// "Hello Sterling Archer"
|
|
21
29
|
|
|
22
|
-
jexl.
|
|
30
|
+
jexl.eval('`Age in 5 years: ${age + 5}`', context)
|
|
23
31
|
// "Age in 5 years: 41"
|
|
24
32
|
|
|
25
|
-
// Filter arrays
|
|
26
|
-
jexl.evalSync('assoc[.first == "Lana"].last', context)
|
|
27
|
-
// "Kane"
|
|
28
|
-
|
|
29
33
|
// Math operations
|
|
30
|
-
jexl.
|
|
34
|
+
jexl.eval('age * (3 - 1)', context)
|
|
31
35
|
// 72
|
|
32
36
|
|
|
33
37
|
// String concatenation
|
|
34
|
-
jexl.
|
|
38
|
+
jexl.eval('name.first + " " + name.last', context)
|
|
35
39
|
// "Sterling Archer"
|
|
36
40
|
|
|
37
41
|
// Conditional logic
|
|
38
|
-
jexl.
|
|
42
|
+
jexl.eval('age > 62 ? "retired" : "working"', context)
|
|
39
43
|
// "working"
|
|
40
44
|
|
|
41
45
|
// Array indexes
|
|
42
|
-
jexl.
|
|
46
|
+
jexl.eval('assoc[1].first', context)
|
|
43
47
|
// "Cyril"
|
|
44
48
|
```
|
|
45
49
|
|
|
@@ -63,17 +67,17 @@ Template strings use backticks and support expression interpolation with `${}`:
|
|
|
63
67
|
```javascript
|
|
64
68
|
const context = { name: 'World', price: 10, qty: 3 }
|
|
65
69
|
|
|
66
|
-
jexl.
|
|
70
|
+
jexl.eval('`Hello ${name}!`', context)
|
|
67
71
|
// "Hello World!"
|
|
68
72
|
|
|
69
|
-
jexl.
|
|
73
|
+
jexl.eval('`Total: $${price * qty}`', context)
|
|
70
74
|
// "Total: $30"
|
|
71
75
|
|
|
72
76
|
// Escape backticks and dollar signs with backslash
|
|
73
|
-
jexl.
|
|
77
|
+
jexl.eval('`Code: \\`example\\``')
|
|
74
78
|
// "Code: `example`"
|
|
75
79
|
|
|
76
|
-
jexl.
|
|
80
|
+
jexl.eval('`Price: \\$100`')
|
|
77
81
|
// "Price: $100"
|
|
78
82
|
```
|
|
79
83
|
|
|
@@ -103,49 +107,10 @@ const context = {
|
|
|
103
107
|
lastEx: 2
|
|
104
108
|
}
|
|
105
109
|
|
|
106
|
-
jexl.
|
|
107
|
-
jexl.
|
|
108
|
-
jexl.
|
|
109
|
-
jexl.
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Filtering Collections
|
|
113
|
-
|
|
114
|
-
Filter arrays using expressions in brackets. Reference properties with a leading dot:
|
|
115
|
-
|
|
116
|
-
```javascript
|
|
117
|
-
const context = {
|
|
118
|
-
employees: [
|
|
119
|
-
{ first: 'Sterling', last: 'Archer', age: 36 },
|
|
120
|
-
{ first: 'Malory', last: 'Archer', age: 75 },
|
|
121
|
-
{ first: 'Lana', last: 'Kane', age: 33 },
|
|
122
|
-
{ first: 'Cyril', last: 'Figgis', age: 45 }
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
jexl.evalSync('employees[.first == "Sterling"]', context)
|
|
127
|
-
// [{ first: 'Sterling', last: 'Archer', age: 36 }]
|
|
128
|
-
|
|
129
|
-
jexl.evalSync('employees[.age >= 30 && .age < 40]', context)
|
|
130
|
-
// [{ first: 'Sterling', ... }, { first: 'Lana', ... }]
|
|
131
|
-
|
|
132
|
-
jexl.evalSync('employees[.last == "Kane"].first', context)
|
|
133
|
-
// "Lana"
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Transforms
|
|
137
|
-
|
|
138
|
-
Apply transforms to values using the pipe operator:
|
|
139
|
-
|
|
140
|
-
```javascript
|
|
141
|
-
jexl.addTransform('upper', (val) => val.toUpperCase())
|
|
142
|
-
jexl.addTransform('split', (val, char) => val.split(char))
|
|
143
|
-
|
|
144
|
-
jexl.evalSync('"hello"|upper')
|
|
145
|
-
// "HELLO"
|
|
146
|
-
|
|
147
|
-
jexl.evalSync('"firstName lastName"|split(" ")[0]')
|
|
148
|
-
// "firstName"
|
|
110
|
+
jexl.eval('name.first', context) // "Malory"
|
|
111
|
+
jexl.eval('name["last"]', context) // "Archer"
|
|
112
|
+
jexl.eval('exes[2]', context) // "Burt"
|
|
113
|
+
jexl.eval('exes[lastEx - 1]', context) // "Len"
|
|
149
114
|
```
|
|
150
115
|
|
|
151
116
|
### Functions
|
|
@@ -156,61 +121,88 @@ Call functions in expressions:
|
|
|
156
121
|
jexl.addFunction('min', Math.min)
|
|
157
122
|
jexl.addFunction('max', Math.max)
|
|
158
123
|
|
|
159
|
-
jexl.
|
|
124
|
+
jexl.eval('min(5, 2, 9)')
|
|
160
125
|
// 2
|
|
161
126
|
|
|
162
|
-
jexl.
|
|
127
|
+
jexl.eval('max(temperature, threshold)')
|
|
163
128
|
// evaluates with context
|
|
164
129
|
```
|
|
165
130
|
|
|
166
|
-
### Multiple Expressions
|
|
167
|
-
|
|
168
|
-
Separate multiple expressions with semicolons. The result is the value of the last expression:
|
|
169
|
-
|
|
170
|
-
```javascript
|
|
171
|
-
jexl.evalSync('5; 10; 15')
|
|
172
|
-
// 15
|
|
173
|
-
|
|
174
|
-
jexl.evalSync('1 + 1; 2 + 2; 3 + 3')
|
|
175
|
-
// 6
|
|
176
|
-
```
|
|
177
|
-
|
|
178
131
|
### Variable Assignment
|
|
179
132
|
|
|
180
133
|
Assign values to variables using `=` (no `let`, `var`, or `const` needed). Assignments mutate the context and return the assigned value:
|
|
181
134
|
|
|
182
135
|
```javascript
|
|
183
|
-
jexl.
|
|
136
|
+
jexl.eval('x = 5')
|
|
184
137
|
// 5
|
|
185
138
|
|
|
186
|
-
jexl.
|
|
139
|
+
jexl.eval('x = 5; x * 2')
|
|
187
140
|
// 10
|
|
188
141
|
|
|
189
|
-
jexl.
|
|
142
|
+
jexl.eval('x = 5; y = 10; x + y')
|
|
190
143
|
// 15
|
|
191
144
|
|
|
192
145
|
const context = {}
|
|
193
|
-
jexl.
|
|
146
|
+
jexl.eval('x = 5; y = x * 2; y', context)
|
|
194
147
|
// 10
|
|
195
148
|
// context is now { x: 5, y: 10 }
|
|
196
149
|
```
|
|
197
150
|
|
|
198
|
-
|
|
151
|
+
Separate multiple expressions with semicolons. The result is the value of the last expression:
|
|
199
152
|
|
|
200
|
-
|
|
201
|
-
import jexl from 'jexl'
|
|
153
|
+
## API
|
|
202
154
|
|
|
203
|
-
|
|
204
|
-
const result = jexl.evalSync('expression', context)
|
|
155
|
+
### Evaluation
|
|
205
156
|
|
|
206
|
-
|
|
207
|
-
|
|
157
|
+
```javascript
|
|
158
|
+
import jexl from '@jbrowse/jexl'
|
|
159
|
+
|
|
160
|
+
// Evaluate an expression
|
|
161
|
+
const result = jexl.eval('expression', context)
|
|
208
162
|
|
|
209
163
|
// Compile once, evaluate many times
|
|
210
164
|
const expr = jexl.compile('name.first + " " + name.last')
|
|
211
|
-
expr.
|
|
165
|
+
const result = expr.eval({ name: { first: 'John', last: 'Doe' } })
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Adding Custom Functions
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
// Add a single function
|
|
172
|
+
jexl.addFunction('round', Math.round)
|
|
173
|
+
jexl.addFunction('lower', (str) => str.toLowerCase())
|
|
174
|
+
|
|
175
|
+
// Add multiple functions
|
|
176
|
+
jexl.addFunctions({
|
|
177
|
+
min: Math.min,
|
|
178
|
+
max: Math.max,
|
|
179
|
+
abs: Math.abs
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
// Use in expressions
|
|
183
|
+
jexl.eval('round(3.7)') // 4
|
|
184
|
+
jexl.eval('lower(name)', { name: 'HELLO' }) // "hello"
|
|
185
|
+
jexl.eval('max(1, 5, 3)') // 5
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Adding Custom Operators
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
// Add a binary operator
|
|
192
|
+
jexl.addBinaryOp(
|
|
193
|
+
'~=',
|
|
194
|
+
20,
|
|
195
|
+
(left, right) => left.toLowerCase() === right.toLowerCase()
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
jexl.eval('"Hello" ~= "hello"') // true
|
|
199
|
+
|
|
200
|
+
// Add a unary operator
|
|
201
|
+
jexl.addUnaryOp('~', (right) => Math.floor(right))
|
|
202
|
+
|
|
203
|
+
jexl.eval('~3.7') // 3
|
|
212
204
|
```
|
|
213
205
|
|
|
214
206
|
## License
|
|
215
207
|
|
|
216
|
-
MIT License
|
|
208
|
+
MIT License, same as TomFrost/Jexl
|
package/dist/Expression.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import PromiseSync from './PromiseSync.ts';
|
|
2
1
|
import type { AstNode } from './types.ts';
|
|
3
2
|
interface Grammar {
|
|
4
3
|
elements: Record<string, any>;
|
|
5
4
|
[key: string]: any;
|
|
6
5
|
}
|
|
7
|
-
type PromiseConstructor = typeof Promise | typeof PromiseSync;
|
|
8
6
|
declare class Expression {
|
|
9
7
|
_grammar: Grammar;
|
|
10
8
|
_exprStr: string;
|
|
@@ -18,21 +16,13 @@ declare class Expression {
|
|
|
18
16
|
*/
|
|
19
17
|
compile(): this;
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {Object} [context] A mapping of variables to values, which will be
|
|
23
|
-
* made accessible to the Jexl expression when evaluating it
|
|
24
|
-
* @returns {Promise<*>} resolves with the result of the evaluation.
|
|
25
|
-
*/
|
|
26
|
-
eval(context?: {}): Promise<any> | PromiseSync<any>;
|
|
27
|
-
/**
|
|
28
|
-
* Synchronously evaluates the expression within an optional context.
|
|
19
|
+
* Evaluates the expression within an optional context.
|
|
29
20
|
* @param {Object} [context] A mapping of variables to values, which will be
|
|
30
21
|
* made accessible to the Jexl expression when evaluating it
|
|
31
22
|
* @returns {*} the result of the evaluation.
|
|
32
23
|
* @throws {*} on error
|
|
33
24
|
*/
|
|
34
|
-
|
|
35
|
-
_eval(context: any, promise: PromiseConstructor): Promise<any> | PromiseSync<any>;
|
|
25
|
+
eval(context?: {}): any;
|
|
36
26
|
_getAst(): AstNode | null;
|
|
37
27
|
}
|
|
38
28
|
export default Expression;
|
package/dist/Expression.js
CHANGED
|
@@ -8,7 +8,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const Lexer_ts_1 = __importDefault(require("./Lexer.js"));
|
|
11
|
-
const PromiseSync_ts_1 = __importDefault(require("./PromiseSync.js"));
|
|
12
11
|
const Evaluator_ts_1 = __importDefault(require("./evaluator/Evaluator.js"));
|
|
13
12
|
const Parser_ts_1 = __importDefault(require("./parser/Parser.js"));
|
|
14
13
|
class Expression {
|
|
@@ -32,37 +31,16 @@ class Expression {
|
|
|
32
31
|
return this;
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param {Object} [context] A mapping of variables to values, which will be
|
|
37
|
-
* made accessible to the Jexl expression when evaluating it
|
|
38
|
-
* @returns {Promise<*>} resolves with the result of the evaluation.
|
|
39
|
-
*/
|
|
40
|
-
eval(context = {}) {
|
|
41
|
-
return this._eval(context, Promise);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Synchronously evaluates the expression within an optional context.
|
|
34
|
+
* Evaluates the expression within an optional context.
|
|
45
35
|
* @param {Object} [context] A mapping of variables to values, which will be
|
|
46
36
|
* made accessible to the Jexl expression when evaluating it
|
|
47
37
|
* @returns {*} the result of the evaluation.
|
|
48
38
|
* @throws {*} on error
|
|
49
39
|
*/
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
throw res.error;
|
|
55
|
-
}
|
|
56
|
-
throw new Error(typeof res.error === 'string' ? res.error : JSON.stringify(res.error));
|
|
57
|
-
}
|
|
58
|
-
return res.value;
|
|
59
|
-
}
|
|
60
|
-
_eval(context, promise) {
|
|
61
|
-
return promise.resolve().then(() => {
|
|
62
|
-
const ast = this._getAst();
|
|
63
|
-
const evaluator = new Evaluator_ts_1.default(this._grammar, context, undefined, promise);
|
|
64
|
-
return evaluator.eval(ast);
|
|
65
|
-
});
|
|
40
|
+
eval(context = {}) {
|
|
41
|
+
const ast = this._getAst();
|
|
42
|
+
const evaluator = new Evaluator_ts_1.default(this._grammar, context);
|
|
43
|
+
return evaluator.eval(ast);
|
|
66
44
|
}
|
|
67
45
|
_getAst() {
|
|
68
46
|
if (!this._ast) {
|
package/dist/Expression.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expression.js","sourceRoot":"","sources":["../src/Expression.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;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CHANGED
|
@@ -2,7 +2,6 @@ import Expression from './Expression.ts';
|
|
|
2
2
|
interface Grammar {
|
|
3
3
|
elements: Record<string, any>;
|
|
4
4
|
functions: Record<string, (...args: any[]) => any>;
|
|
5
|
-
transforms: Record<string, (val: any, ...args: any[]) => any>;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* Jexl is the Javascript Expression Language, capable of parsing and
|
|
@@ -26,13 +25,11 @@ declare class Jexl {
|
|
|
26
25
|
* @param {number} precedence The operator's precedence
|
|
27
26
|
* @param {function} fn A function to run to calculate the result. The function
|
|
28
27
|
* will be called with two arguments: left and right, denoting the values
|
|
29
|
-
* on either side of the operator. It should return
|
|
30
|
-
* value, or a Promise that resolves with the resulting value.
|
|
28
|
+
* on either side of the operator. It should return the resulting value.
|
|
31
29
|
* @param {boolean} [manualEval] If true, the `left` and `right` arguments
|
|
32
30
|
* will be wrapped in objects with an `eval` function. Calling
|
|
33
|
-
* left.eval() or right.eval() will return
|
|
34
|
-
*
|
|
35
|
-
* operands.
|
|
31
|
+
* left.eval() or right.eval() will return that operand's actual value.
|
|
32
|
+
* This is useful to conditionally evaluate operands.
|
|
36
33
|
*/
|
|
37
34
|
addBinaryOp(operator: string, precedence: number, fn: (left: any, right: any) => any, manualEval?: boolean): void;
|
|
38
35
|
/**
|
|
@@ -57,26 +54,9 @@ declare class Jexl {
|
|
|
57
54
|
* @param {string} operator The operator string to be added
|
|
58
55
|
* @param {function} fn A function to run to calculate the result. The function
|
|
59
56
|
* will be called with one argument: the literal value to the right of the
|
|
60
|
-
* operator. It should return
|
|
61
|
-
* that resolves with the resulting value.
|
|
57
|
+
* operator. It should return the resulting value.
|
|
62
58
|
*/
|
|
63
59
|
addUnaryOp(operator: string, fn: (right: any) => any): void;
|
|
64
|
-
/**
|
|
65
|
-
* Adds or replaces a transform function in this Jexl instance.
|
|
66
|
-
* @param {string} name The name of the transform function, as it will be used
|
|
67
|
-
* within Jexl expressions
|
|
68
|
-
* @param {function} fn The function to be executed when this transform is
|
|
69
|
-
* invoked. It will be provided with at least one argument:
|
|
70
|
-
* - {*} value: The value to be transformed
|
|
71
|
-
* - {...*} args: The arguments for this transform
|
|
72
|
-
*/
|
|
73
|
-
addTransform(name: string, fn: (val: any, ...args: any[]) => any): void;
|
|
74
|
-
/**
|
|
75
|
-
* Syntactic sugar for calling {@link #addTransform} repeatedly. This function
|
|
76
|
-
* accepts a map of one or more transform names to their transform function.
|
|
77
|
-
* @param {{}} map A map of transform names to transform functions
|
|
78
|
-
*/
|
|
79
|
-
addTransforms(map: Record<string, (val: any, ...args: any[]) => any>): void;
|
|
80
60
|
/**
|
|
81
61
|
* Creates an Expression object from the given Jexl expression string, and
|
|
82
62
|
* immediately compiles it. The returned Expression object can then be
|
|
@@ -100,28 +80,14 @@ declare class Jexl {
|
|
|
100
80
|
*/
|
|
101
81
|
getFunction(name: string): (...args: any[]) => any;
|
|
102
82
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @param {string} name The name of the transform function
|
|
105
|
-
* @returns {function} The transform function
|
|
106
|
-
*/
|
|
107
|
-
getTransform(name: string): (val: any, ...args: any[]) => any;
|
|
108
|
-
/**
|
|
109
|
-
* Asynchronously evaluates a Jexl string within an optional context.
|
|
110
|
-
* @param {string} expression The Jexl expression to be evaluated
|
|
111
|
-
* @param {Object} [context] A mapping of variables to values, which will be
|
|
112
|
-
* made accessible to the Jexl expression when evaluating it
|
|
113
|
-
* @returns {Promise<*>} resolves with the result of the evaluation.
|
|
114
|
-
*/
|
|
115
|
-
eval(expression: string, context?: {}): Promise<any> | import("./PromiseSync.ts").default<any>;
|
|
116
|
-
/**
|
|
117
|
-
* Synchronously evaluates a Jexl string within an optional context.
|
|
83
|
+
* Evaluates a Jexl string within an optional context.
|
|
118
84
|
* @param {string} expression The Jexl expression to be evaluated
|
|
119
85
|
* @param {Object} [context] A mapping of variables to values, which will be
|
|
120
86
|
* made accessible to the Jexl expression when evaluating it
|
|
121
87
|
* @returns {*} the result of the evaluation.
|
|
122
88
|
* @throws {*} on error
|
|
123
89
|
*/
|
|
124
|
-
|
|
90
|
+
eval(expression: string, context?: {}): any;
|
|
125
91
|
/**
|
|
126
92
|
* A JavaScript template literal to allow expressions to be defined by the
|
|
127
93
|
* syntax: expr`40 + 2`
|
package/dist/Jexl.js
CHANGED
|
@@ -34,13 +34,11 @@ class Jexl {
|
|
|
34
34
|
* @param {number} precedence The operator's precedence
|
|
35
35
|
* @param {function} fn A function to run to calculate the result. The function
|
|
36
36
|
* will be called with two arguments: left and right, denoting the values
|
|
37
|
-
* on either side of the operator. It should return
|
|
38
|
-
* value, or a Promise that resolves with the resulting value.
|
|
37
|
+
* on either side of the operator. It should return the resulting value.
|
|
39
38
|
* @param {boolean} [manualEval] If true, the `left` and `right` arguments
|
|
40
39
|
* will be wrapped in objects with an `eval` function. Calling
|
|
41
|
-
* left.eval() or right.eval() will return
|
|
42
|
-
*
|
|
43
|
-
* operands.
|
|
40
|
+
* left.eval() or right.eval() will return that operand's actual value.
|
|
41
|
+
* This is useful to conditionally evaluate operands.
|
|
44
42
|
*/
|
|
45
43
|
addBinaryOp(operator, precedence, fn, manualEval) {
|
|
46
44
|
this._addGrammarElement(operator, {
|
|
@@ -75,8 +73,7 @@ class Jexl {
|
|
|
75
73
|
* @param {string} operator The operator string to be added
|
|
76
74
|
* @param {function} fn A function to run to calculate the result. The function
|
|
77
75
|
* will be called with one argument: the literal value to the right of the
|
|
78
|
-
* operator. It should return
|
|
79
|
-
* that resolves with the resulting value.
|
|
76
|
+
* operator. It should return the resulting value.
|
|
80
77
|
*/
|
|
81
78
|
addUnaryOp(operator, fn) {
|
|
82
79
|
this._addGrammarElement(operator, {
|
|
@@ -85,26 +82,6 @@ class Jexl {
|
|
|
85
82
|
eval: fn
|
|
86
83
|
});
|
|
87
84
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Adds or replaces a transform function in this Jexl instance.
|
|
90
|
-
* @param {string} name The name of the transform function, as it will be used
|
|
91
|
-
* within Jexl expressions
|
|
92
|
-
* @param {function} fn The function to be executed when this transform is
|
|
93
|
-
* invoked. It will be provided with at least one argument:
|
|
94
|
-
* - {*} value: The value to be transformed
|
|
95
|
-
* - {...*} args: The arguments for this transform
|
|
96
|
-
*/
|
|
97
|
-
addTransform(name, fn) {
|
|
98
|
-
this._grammar.transforms[name] = fn;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Syntactic sugar for calling {@link #addTransform} repeatedly. This function
|
|
102
|
-
* accepts a map of one or more transform names to their transform function.
|
|
103
|
-
* @param {{}} map A map of transform names to transform functions
|
|
104
|
-
*/
|
|
105
|
-
addTransforms(map) {
|
|
106
|
-
Object.assign(this._grammar.transforms, map);
|
|
107
|
-
}
|
|
108
85
|
/**
|
|
109
86
|
* Creates an Expression object from the given Jexl expression string, and
|
|
110
87
|
* immediately compiles it. The returned Expression object can then be
|
|
@@ -135,35 +112,16 @@ class Jexl {
|
|
|
135
112
|
return this._grammar.functions[name];
|
|
136
113
|
}
|
|
137
114
|
/**
|
|
138
|
-
*
|
|
139
|
-
* @param {string} name The name of the transform function
|
|
140
|
-
* @returns {function} The transform function
|
|
141
|
-
*/
|
|
142
|
-
getTransform(name) {
|
|
143
|
-
return this._grammar.transforms[name];
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Asynchronously evaluates a Jexl string within an optional context.
|
|
147
|
-
* @param {string} expression The Jexl expression to be evaluated
|
|
148
|
-
* @param {Object} [context] A mapping of variables to values, which will be
|
|
149
|
-
* made accessible to the Jexl expression when evaluating it
|
|
150
|
-
* @returns {Promise<*>} resolves with the result of the evaluation.
|
|
151
|
-
*/
|
|
152
|
-
eval(expression, context = {}) {
|
|
153
|
-
const exprObj = this.createExpression(expression);
|
|
154
|
-
return exprObj.eval(context);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Synchronously evaluates a Jexl string within an optional context.
|
|
115
|
+
* Evaluates a Jexl string within an optional context.
|
|
158
116
|
* @param {string} expression The Jexl expression to be evaluated
|
|
159
117
|
* @param {Object} [context] A mapping of variables to values, which will be
|
|
160
118
|
* made accessible to the Jexl expression when evaluating it
|
|
161
119
|
* @returns {*} the result of the evaluation.
|
|
162
120
|
* @throws {*} on error
|
|
163
121
|
*/
|
|
164
|
-
|
|
122
|
+
eval(expression, context = {}) {
|
|
165
123
|
const exprObj = this.createExpression(expression);
|
|
166
|
-
return exprObj.
|
|
124
|
+
return exprObj.eval(context);
|
|
167
125
|
}
|
|
168
126
|
/**
|
|
169
127
|
* A JavaScript template literal to allow expressions to be defined by the
|
package/dist/Jexl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jexl.js","sourceRoot":"","sources":["../src/Jexl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oEAAwC;AACxC,6CAAyC;
|
|
1
|
+
{"version":3,"file":"Jexl.js","sourceRoot":"","sources":["../src/Jexl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oEAAwC;AACxC,6CAAyC;AAOzC;;;;;GAKG;AACH,MAAM,IAAI;IAGR;QACE,IAAI,CAAC,QAAQ,GAAG,IAAA,uBAAU,GAAE,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAClC,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CACT,QAAgB,EAChB,UAAkB,EAClB,EAAkC,EAClC,UAAoB;QAEpB,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;YAChC,IAAI,EAAE,UAAU;YAChB,UAAU,EAAE,UAAU;YACtB,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE;SAC3C,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,IAAY,EAAE,EAA2B;QACnD,IAAI,CAAC,QAAQ,CA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