@briza/illogical 1.4.3 → 1.5.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 +13 -0
- package/lib/illogical.esm.js +82 -176
- package/lib/illogical.js +82 -175
- package/package.json +23 -23
- package/readme.md +21 -7
- package/types/common/evaluable.d.ts +57 -57
- package/types/common/type-check.d.ts +28 -32
- package/types/common/util.d.ts +11 -11
- package/types/expression/comparison/eq.d.ts +18 -22
- package/types/expression/comparison/ge.d.ts +18 -22
- package/types/expression/comparison/gt.d.ts +18 -22
- package/types/expression/comparison/in.d.ts +23 -27
- package/types/expression/comparison/index.d.ts +45 -49
- package/types/expression/comparison/le.d.ts +18 -22
- package/types/expression/comparison/lt.d.ts +18 -22
- package/types/expression/comparison/ne.d.ts +18 -22
- package/types/expression/comparison/not-in.d.ts +23 -27
- package/types/expression/comparison/overlap.d.ts +23 -27
- package/types/expression/comparison/prefix.d.ts +23 -27
- package/types/expression/comparison/present.d.ts +25 -29
- package/types/expression/comparison/suffix.d.ts +23 -27
- package/types/expression/comparison/undefined.d.ts +28 -32
- package/types/expression/logical/and.d.ts +23 -27
- package/types/expression/logical/index.d.ts +32 -36
- package/types/expression/logical/nor.d.ts +23 -27
- package/types/expression/logical/not.d.ts +23 -27
- package/types/expression/logical/or.d.ts +23 -27
- package/types/expression/logical/xor.d.ts +23 -27
- package/types/index.d.ts +73 -71
- package/types/operand/collection.d.ts +36 -40
- package/types/operand/index.d.ts +25 -29
- package/types/operand/reference.d.ts +44 -48
- package/types/operand/value.d.ts +31 -35
- package/types/parser/index.d.ts +39 -43
- package/types/parser/options.d.ts +61 -65
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A micro conditional javascript engine used to parse the raw logical and comparison expressions, evaluate the expression in the given data context, and provide access to a text form of the given expressions.
|
|
4
4
|
|
|
5
|
-
> Revision:
|
|
5
|
+
> Revision: February 1, 2022.
|
|
6
6
|
|
|
7
7
|
## About
|
|
8
8
|
|
|
@@ -178,7 +178,7 @@ evaluable.toString()
|
|
|
178
178
|
### Simplify
|
|
179
179
|
|
|
180
180
|
Simplifies an expression with a given context. This is useful when you already have some of
|
|
181
|
-
the properties of context and wants to try to
|
|
181
|
+
the properties of context and wants to try to evaluate the expression.
|
|
182
182
|
|
|
183
183
|
**Example**
|
|
184
184
|
|
|
@@ -192,8 +192,8 @@ Values not found in the context will cause the parent operand not to be evaluate
|
|
|
192
192
|
as part of the simplified expression.
|
|
193
193
|
|
|
194
194
|
In some situations we might want to evaluate the expression even if referred value is not
|
|
195
|
-
present. You can provide a list of keys that will be evaluated even if they are not
|
|
196
|
-
in the context.
|
|
195
|
+
present. You can provide a list of keys that will be strictly evaluated even if they are not
|
|
196
|
+
present in the context.
|
|
197
197
|
|
|
198
198
|
**Example**
|
|
199
199
|
|
|
@@ -201,10 +201,24 @@ in the context.
|
|
|
201
201
|
engine.simplify(
|
|
202
202
|
['AND', ['==', '$a', 10], ['==', '$b', 20]],
|
|
203
203
|
{ a: 10 },
|
|
204
|
-
['b'] // '$b' will be
|
|
204
|
+
['b'] // '$b' will be evaluated to undefined.
|
|
205
205
|
) // false
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
+
Alternatively we might want to do the opposite and strictly evaluate the expression for all referred
|
|
209
|
+
values not present in the context except for a specified list of optional keys.
|
|
210
|
+
|
|
211
|
+
**Example**
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
engine.simplify(
|
|
215
|
+
['OR', ['==', '$a', 10], ['==', '$b', 20], ['==', '$c', 20]],
|
|
216
|
+
{ c: 10 },
|
|
217
|
+
undefined,
|
|
218
|
+
['b'] // except for '$b' everything not in context will be evaluated to undefined.
|
|
219
|
+
) // ['==', '$b', 20]
|
|
220
|
+
```
|
|
221
|
+
|
|
208
222
|
## Working with Expressions
|
|
209
223
|
|
|
210
224
|
### Evaluation Data Context
|
|
@@ -311,7 +325,7 @@ Simple value types: string, number, boolean.
|
|
|
311
325
|
|
|
312
326
|
#### Reference
|
|
313
327
|
|
|
314
|
-
The reference operand
|
|
328
|
+
The reference operand value is resolved from the [Evaluation Data Context](#evaluation-data-context), where the the operands name is used as key in the context.
|
|
315
329
|
|
|
316
330
|
The reference operand must be prefixed with `$` symbol, e.g.: `$name`. This might be customized via [Reference Predicate Parser Option](#reference-predicate).
|
|
317
331
|
|
|
@@ -676,7 +690,7 @@ A function used to transform the operand into the reference annotation stripped
|
|
|
676
690
|
referenceTransform: (operand: string) => string
|
|
677
691
|
```
|
|
678
692
|
|
|
679
|
-
> **Default reference transform:**
|
|
693
|
+
> **Default reference transform:**
|
|
680
694
|
> It removes the `$` symbol at the begging of the operand name.
|
|
681
695
|
|
|
682
696
|
#### Operator Mapping
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
export {};
|
|
1
|
+
import { Input } from '../parser';
|
|
2
|
+
import { Options } from '../parser/options';
|
|
3
|
+
/**
|
|
4
|
+
* Valid types for context members
|
|
5
|
+
*/
|
|
6
|
+
declare type ContextValue = Record<string, unknown> | string | number | boolean | null | undefined | ContextValue[];
|
|
7
|
+
/**
|
|
8
|
+
* Evaluation Context
|
|
9
|
+
* Holds references used during the evaluation process.
|
|
10
|
+
* Format: key: value.
|
|
11
|
+
*/
|
|
12
|
+
export interface Context {
|
|
13
|
+
[k: string]: ContextValue;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Evaluation result
|
|
17
|
+
*/
|
|
18
|
+
export declare type Result = undefined | null | string | number | boolean | Array<Result>;
|
|
19
|
+
export declare enum EvaluableType {
|
|
20
|
+
Operand = "Operand",
|
|
21
|
+
Expression = "Expression"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Evaluable
|
|
25
|
+
*/
|
|
26
|
+
export interface Evaluable {
|
|
27
|
+
type: EvaluableType;
|
|
28
|
+
/**
|
|
29
|
+
* Evaluate in the given context.
|
|
30
|
+
* @param {Context} ctx
|
|
31
|
+
* @return {Result}
|
|
32
|
+
*/
|
|
33
|
+
evaluate(ctx: Context): Result;
|
|
34
|
+
/**
|
|
35
|
+
* Simplifies this Evaluable when possible.
|
|
36
|
+
*
|
|
37
|
+
* @param {Context} ctx context for the evaluation
|
|
38
|
+
* @param {string[]} strictKeys keys to be considered present even if they are not present in the context
|
|
39
|
+
* @param {string[]} optionalKeys keys to be considered not present unless they are in the context or in
|
|
40
|
+
* `strictKeys`; when `strictKeys` is `undefined` and `optionalKeys` is an array, every key that is not in
|
|
41
|
+
* `optionalKeys` is considered to be present and thus will be evaluated
|
|
42
|
+
* @returns {Result | Evaluable} simplified value or itself
|
|
43
|
+
*/
|
|
44
|
+
simplify(ctx: Context, strictKeys?: string[], optionalKeys?: string[]): Result | Evaluable;
|
|
45
|
+
/**
|
|
46
|
+
* Serializes the Evaluable to its input format.
|
|
47
|
+
*
|
|
48
|
+
* @param {Options} options parser options
|
|
49
|
+
*/
|
|
50
|
+
serialize(options: Options): Input;
|
|
51
|
+
/**
|
|
52
|
+
* Get the strict representation of the evaluable expression.
|
|
53
|
+
*/
|
|
54
|
+
toString(): string;
|
|
55
|
+
}
|
|
56
|
+
export declare type SimplifyArgs = Parameters<Evaluable['simplify']>;
|
|
57
|
+
export {};
|
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* @param {Result | Evaluable} value value to check if is Evaluable
|
|
30
|
-
* @returns {Evaluable}
|
|
31
|
-
*/
|
|
32
|
-
export declare function isEvaluable(value: Result | Evaluable): value is Evaluable;
|
|
1
|
+
import { Evaluable, Result } from './evaluable';
|
|
2
|
+
/**
|
|
3
|
+
* Is number predicate.
|
|
4
|
+
* @param value Tested value.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isNumber(value: Result): value is number;
|
|
7
|
+
/**
|
|
8
|
+
* Is string type predicate.
|
|
9
|
+
* @param value Tested value.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isString(value: Result): value is string;
|
|
12
|
+
/**
|
|
13
|
+
* Is Object
|
|
14
|
+
* @param value tested value result of the test
|
|
15
|
+
*/
|
|
16
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Is Boolean predicate.
|
|
19
|
+
* @param value tested value.
|
|
20
|
+
* @return result of the test
|
|
21
|
+
*/
|
|
22
|
+
export declare function isBoolean(value: unknown): value is boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Check if a value is a an Evaluable
|
|
25
|
+
* @param {Result | Evaluable} value value to check if is Evaluable
|
|
26
|
+
* @returns {Evaluable}
|
|
27
|
+
*/
|
|
28
|
+
export declare function isEvaluable(value: Result | Evaluable): value is Evaluable;
|
package/types/common/util.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Result } from './evaluable';
|
|
2
|
-
/**
|
|
3
|
-
* Convert a value to number if possible, otherwise return undefined
|
|
4
|
-
* @param value value to be converted to number
|
|
5
|
-
*/
|
|
6
|
-
export declare const toNumber: (value: Result) => number | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Convert a value to string if possible, otherwise return undefined
|
|
9
|
-
* @param value value to be converted to string
|
|
10
|
-
*/
|
|
11
|
-
export declare const toString: (value: Result) => string | undefined;
|
|
1
|
+
import { Result } from './evaluable';
|
|
2
|
+
/**
|
|
3
|
+
* Convert a value to number if possible, otherwise return undefined
|
|
4
|
+
* @param value value to be converted to number
|
|
5
|
+
*/
|
|
6
|
+
export declare const toNumber: (value: Result) => number | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Convert a value to string if possible, otherwise return undefined
|
|
9
|
+
* @param value value to be converted to string
|
|
10
|
+
*/
|
|
11
|
+
export declare const toString: (value: Result) => string | undefined;
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* {@link Comparison.comparison}
|
|
20
|
-
*/
|
|
21
|
-
comparison(left: Result, right: Result): boolean;
|
|
22
|
-
}
|
|
1
|
+
import { Evaluable, Result } from '../../common/evaluable';
|
|
2
|
+
import { Comparison } from '../comparison';
|
|
3
|
+
export declare const OPERATOR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Equal comparison expression
|
|
6
|
+
*/
|
|
7
|
+
export declare class Equal extends Comparison {
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {Evaluable} left Left operand.
|
|
11
|
+
* @param {Evaluable} right Right operand.
|
|
12
|
+
*/
|
|
13
|
+
constructor(...args: Evaluable[]);
|
|
14
|
+
/**
|
|
15
|
+
* {@link Comparison.comparison}
|
|
16
|
+
*/
|
|
17
|
+
comparison(left: Result, right: Result): boolean;
|
|
18
|
+
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* {@link Comparison.comparison}
|
|
20
|
-
*/
|
|
21
|
-
comparison(left: Result, right: Result): boolean;
|
|
22
|
-
}
|
|
1
|
+
import { Evaluable, Result } from '../../common/evaluable';
|
|
2
|
+
import { Comparison } from '../comparison';
|
|
3
|
+
export declare const OPERATOR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Greater than or equal comparison expression
|
|
6
|
+
*/
|
|
7
|
+
export declare class GreaterThanOrEqual extends Comparison {
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {Evaluable} left Left operand.
|
|
11
|
+
* @param {Evaluable} right Right operand.
|
|
12
|
+
*/
|
|
13
|
+
constructor(...args: Evaluable[]);
|
|
14
|
+
/**
|
|
15
|
+
* {@link Comparison.comparison}
|
|
16
|
+
*/
|
|
17
|
+
comparison(left: Result, right: Result): boolean;
|
|
18
|
+
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* {@link Comparison.comparison}
|
|
20
|
-
*/
|
|
21
|
-
comparison(left: Result, right: Result): boolean;
|
|
22
|
-
}
|
|
1
|
+
import { Evaluable, Result } from '../../common/evaluable';
|
|
2
|
+
import { Comparison } from '../comparison';
|
|
3
|
+
export declare const OPERATOR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Greater than comparison expression
|
|
6
|
+
*/
|
|
7
|
+
export declare class GreaterThan extends Comparison {
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {Evaluable} left Left operand.
|
|
11
|
+
* @param {Evaluable} right Right operand.
|
|
12
|
+
*/
|
|
13
|
+
constructor(...args: Evaluable[]);
|
|
14
|
+
/**
|
|
15
|
+
* {@link Comparison.comparison}
|
|
16
|
+
*/
|
|
17
|
+
comparison(left: Result, right: Result): boolean;
|
|
18
|
+
}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @return {string}
|
|
25
|
-
*/
|
|
26
|
-
toString(): string;
|
|
27
|
-
}
|
|
1
|
+
import { Evaluable, Result } from '../../common/evaluable';
|
|
2
|
+
import { Comparison } from '../comparison';
|
|
3
|
+
export declare const OPERATOR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* In comparison expression
|
|
6
|
+
*/
|
|
7
|
+
export declare class In extends Comparison {
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {Evaluable} left Left operand.
|
|
11
|
+
* @param {Evaluable} right Right operand.
|
|
12
|
+
*/
|
|
13
|
+
constructor(...args: Evaluable[]);
|
|
14
|
+
/**
|
|
15
|
+
* {@link Comparison.comparison}
|
|
16
|
+
*/
|
|
17
|
+
comparison(left: Result, right: Result): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get the strict representation of the expression.
|
|
20
|
+
* @return {string}
|
|
21
|
+
*/
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
@@ -1,49 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* @
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
* @
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* {@link Evaluable.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
* {@link Evaluable.serialize}
|
|
47
|
-
*/
|
|
48
|
-
serialize(options: Options): ExpressionInput;
|
|
49
|
-
}
|
|
1
|
+
import { Context, Evaluable, EvaluableType, Result, SimplifyArgs } from '../../common/evaluable';
|
|
2
|
+
import { Operand } from '../../operand';
|
|
3
|
+
import { ExpressionInput } from '../../parser';
|
|
4
|
+
import { Options } from '../../parser/options';
|
|
5
|
+
/**
|
|
6
|
+
* Abstract comparison expression
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class Comparison implements Evaluable {
|
|
9
|
+
protected readonly operator: string;
|
|
10
|
+
protected readonly operatorSymbol: symbol;
|
|
11
|
+
protected readonly left: Operand;
|
|
12
|
+
protected readonly right: Operand;
|
|
13
|
+
type: EvaluableType;
|
|
14
|
+
/**
|
|
15
|
+
* @constructor
|
|
16
|
+
* @param {string} operator String representation of the operator.
|
|
17
|
+
* @param {Operand} left Left operand.
|
|
18
|
+
* @param {Operand} right Right operand.
|
|
19
|
+
*/
|
|
20
|
+
constructor(operator: string, operatorSymbol: symbol, left: Operand, right: Operand);
|
|
21
|
+
/**
|
|
22
|
+
* {@link Evaluable.evaluate}
|
|
23
|
+
*/
|
|
24
|
+
evaluate(ctx: Context): Result;
|
|
25
|
+
/**
|
|
26
|
+
* Get the strict representation of the expression.
|
|
27
|
+
* @return {string}
|
|
28
|
+
*/
|
|
29
|
+
toString(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Compares left and right operands evaluated values.
|
|
32
|
+
* @param {Result} left left operand result value
|
|
33
|
+
* @param {Result} right right operand result value
|
|
34
|
+
* @returns {boolean}
|
|
35
|
+
*/
|
|
36
|
+
abstract comparison(left: Result, right: Result): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* {@link Evaluable.simplify}
|
|
39
|
+
*/
|
|
40
|
+
simplify(...args: SimplifyArgs): Result | Evaluable;
|
|
41
|
+
/**
|
|
42
|
+
* {@link Evaluable.serialize}
|
|
43
|
+
*/
|
|
44
|
+
serialize(options: Options): ExpressionInput;
|
|
45
|
+
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* {@link Comparison.comparison}
|
|
20
|
-
*/
|
|
21
|
-
comparison(left: Result, right: Result): boolean;
|
|
22
|
-
}
|
|
1
|
+
import { Evaluable, Result } from '../../common/evaluable';
|
|
2
|
+
import { Comparison } from '../comparison';
|
|
3
|
+
export declare const OPERATOR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Less than or equal comparison expression
|
|
6
|
+
*/
|
|
7
|
+
export declare class LessThanOrEqual extends Comparison {
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {Evaluable} left Left operand.
|
|
11
|
+
* @param {Evaluable} right Right operand.
|
|
12
|
+
*/
|
|
13
|
+
constructor(...args: Evaluable[]);
|
|
14
|
+
/**
|
|
15
|
+
* {@link Comparison.comparison}
|
|
16
|
+
*/
|
|
17
|
+
comparison(left: Result, right: Result): boolean;
|
|
18
|
+
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* {@link Comparison.comparison}
|
|
20
|
-
*/
|
|
21
|
-
comparison(left: Result, right: Result): boolean;
|
|
22
|
-
}
|
|
1
|
+
import { Evaluable, Result } from '../../common/evaluable';
|
|
2
|
+
import { Comparison } from '../comparison';
|
|
3
|
+
export declare const OPERATOR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Less than comparison expression
|
|
6
|
+
*/
|
|
7
|
+
export declare class LessThan extends Comparison {
|
|
8
|
+
/**
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {Evaluable} left Left operand.
|
|
11
|
+
* @param {Evaluable} right Right operand.
|
|
12
|
+
*/
|
|
13
|
+
constructor(...args: Evaluable[]);
|
|
14
|
+
/**
|
|
15
|
+
* {@link Comparison.comparison}
|
|
16
|
+
*/
|
|
17
|
+
comparison(left: Result, right: Result): boolean;
|
|
18
|
+
}
|