@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
|
@@ -1,65 +1,61 @@
|
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export declare const
|
|
62
|
-
/**
|
|
63
|
-
* Default parser options
|
|
64
|
-
*/
|
|
65
|
-
export declare const defaultOptions: Options;
|
|
1
|
+
export declare type optionValue = ((operand: string) => string | boolean) | Map<symbol, string>;
|
|
2
|
+
export interface Options {
|
|
3
|
+
/**
|
|
4
|
+
* A function used to determine if the operand is a reference type,
|
|
5
|
+
* otherwise evaluated as a static value.
|
|
6
|
+
* @param {string} operand
|
|
7
|
+
* @return {boolean}
|
|
8
|
+
* * True = reference
|
|
9
|
+
* * False = value
|
|
10
|
+
*/
|
|
11
|
+
referencePredicate: (operand: string) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A function used to transform the operand into the reference annotation
|
|
14
|
+
* stripped form. I.e. remove any annotation used to detect the
|
|
15
|
+
* reference type.
|
|
16
|
+
* E.g. "$Reference" => "Reference"
|
|
17
|
+
* @param {string} operand
|
|
18
|
+
* @return {string}
|
|
19
|
+
*/
|
|
20
|
+
referenceTransform: (operand: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* A function used to transform the stripped form of a reference into an
|
|
23
|
+
* annotated version of the reference. This function should be the inverse
|
|
24
|
+
* function of referenceTranform.
|
|
25
|
+
*
|
|
26
|
+
* referenceSerialization(referenceTransform("$Reference")) === '$Reference'
|
|
27
|
+
*
|
|
28
|
+
* E.g. "Reference" => "$Reference"
|
|
29
|
+
* @param {string} operand
|
|
30
|
+
* @return {string}
|
|
31
|
+
*/
|
|
32
|
+
referenceSerialization: (operand: string) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Mapping of the operators. The key is unique operator key, and the value
|
|
35
|
+
* is the key used to represent the given operator in the raw expression.
|
|
36
|
+
*/
|
|
37
|
+
operatorMapping: Map<symbol, string>;
|
|
38
|
+
[k: string]: optionValue;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Default reference predicate.
|
|
42
|
+
* The "$" symbol at the begging of the operand is used
|
|
43
|
+
* to predicate the reference type.
|
|
44
|
+
* E.g. "$State", "$Country"
|
|
45
|
+
* @param {string} key
|
|
46
|
+
* @return {boolean}
|
|
47
|
+
*/
|
|
48
|
+
export declare function defaultReferencePredicate(key: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Default reference transform.
|
|
51
|
+
* It removes the "$" symbol at the begging of the operand name.
|
|
52
|
+
* @param {string} key
|
|
53
|
+
* @return {string}
|
|
54
|
+
*/
|
|
55
|
+
export declare function defaultReferenceTransform(key: string): string;
|
|
56
|
+
export declare function defaultReferenceSerialization(key: string): string;
|
|
57
|
+
export declare const defaultOperatorMapping: Map<symbol, string>;
|
|
58
|
+
/**
|
|
59
|
+
* Default parser options
|
|
60
|
+
*/
|
|
61
|
+
export declare const defaultOptions: Options;
|