@allgemein/mango-expressions 1.3.1 → 1.4.0
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/AExpr.d.ts +11 -0
- package/AExpr.js +37 -0
- package/AExpr.js.map +1 -0
- package/Constants.d.ts +3 -0
- package/Constants.js +2 -5
- package/Constants.js.map +1 -1
- package/IWalker.d.ts +19 -0
- package/IWalker.js +2 -0
- package/IWalker.js.map +1 -0
- package/README.md +69 -1
- package/_Expr.d.ts +1 -0
- package/_Expr.js +52 -0
- package/_Expr.js.map +1 -0
- package/ast/AbstractValue.d.ts +7 -0
- package/ast/AbstractValue.js +27 -0
- package/ast/AbstractValue.js.map +1 -0
- package/ast/Bindings.d.ts +1 -2
- package/ast/Bindings.js +1 -5
- package/ast/Bindings.js.map +1 -1
- package/ast/Constan.d.ts +11 -0
- package/ast/Constan.js +2 -0
- package/ast/Constan.js.map +1 -0
- package/ast/Context.js +8 -12
- package/ast/Context.js.map +1 -1
- package/ast/Expr.d.ts +23 -0
- package/ast/Expr.js +90 -0
- package/ast/Expr.js.map +1 -0
- package/ast/IExpr.d.ts +16 -0
- package/ast/IExpr.js +2 -0
- package/ast/IExpr.js.map +1 -0
- package/ast/IParser.d.ts +14 -0
- package/ast/IParser.js +2 -0
- package/ast/IParser.js.map +1 -0
- package/ast/IStackEntry.d.ts +13 -0
- package/ast/IStackEntry.js +2 -0
- package/ast/IStackEntry.js.map +1 -0
- package/ast/JsonParser.d.ts +25 -0
- package/ast/JsonParser.js +60 -0
- package/ast/JsonParser.js.map +1 -0
- package/ast/KeyDesc.d.ts +2 -4
- package/ast/KeyDesc.js +4 -9
- package/ast/KeyDesc.js.map +1 -1
- package/ast/MultiArgs.js +1 -5
- package/ast/MultiArgs.js.map +1 -1
- package/ast/PArray.d.ts +1 -10
- package/ast/PArray.js +67 -53
- package/ast/PArray.js.map +1 -1
- package/ast/PObject.d.ts +1 -17
- package/ast/PObject.js +130 -108
- package/ast/PObject.js.map +1 -1
- package/ast/RefDesc.d.ts +5 -0
- package/ast/RefDesc.js +12 -0
- package/ast/RefDesc.js.map +1 -0
- package/ast/Selector.d.ts +19 -5
- package/ast/Selector.js +31 -9
- package/ast/Selector.js.map +1 -1
- package/ast/StackEntry.d.ts +24 -0
- package/ast/StackEntry.js +121 -0
- package/ast/StackEntry.js.map +1 -0
- package/ast/StringParser.d.ts +16 -0
- package/ast/StringParser.js +303 -0
- package/ast/StringParser.js.map +1 -0
- package/ast/Unset.d.ts +2 -2
- package/ast/Unset.js +2 -6
- package/ast/Unset.js.map +1 -1
- package/ast/ValueDesc.d.ts +4 -0
- package/ast/ValueDesc.js +9 -0
- package/ast/ValueDesc.js.map +1 -0
- package/ast/functions.d.ts +1 -0
- package/ast/functions.js +8 -0
- package/ast/functions.js.map +1 -0
- package/browser.d.ts +52 -55
- package/browser.js +53 -116
- package/browser.js.map +1 -1
- package/errors/InvalidValueError.d.ts +4 -0
- package/errors/InvalidValueError.js +6 -0
- package/errors/InvalidValueError.js.map +1 -0
- package/errors/NotYetImplementedError.d.ts +3 -0
- package/errors/NotYetImplementedError.js +6 -0
- package/errors/NotYetImplementedError.js.map +1 -0
- package/errors/UnsupportedInputError.d.ts +3 -0
- package/errors/UnsupportedInputError.js +6 -0
- package/errors/UnsupportedInputError.js.map +1 -0
- package/functions.d.ts +9 -0
- package/functions.js +107 -0
- package/functions.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +5 -60
- package/index.js.map +1 -1
- package/operators/AbstractCompare.d.ts +23 -0
- package/operators/AbstractCompare.js +100 -0
- package/operators/AbstractCompare.js.map +1 -0
- package/operators/AbstractFunction.d.ts +6 -0
- package/operators/AbstractFunction.js +10 -0
- package/operators/AbstractFunction.js.map +1 -0
- package/operators/AbstractJunctor.d.ts +13 -0
- package/operators/AbstractJunctor.js +31 -0
- package/operators/AbstractJunctor.js.map +1 -0
- package/operators/AbstractJunctorArray.d.ts +18 -0
- package/operators/AbstractJunctorArray.js +63 -0
- package/operators/AbstractJunctorArray.js.map +1 -0
- package/operators/AbstractOperator.d.ts +6 -6
- package/operators/AbstractOperator.js +12 -31
- package/operators/AbstractOperator.js.map +1 -1
- package/operators/Components.d.ts +30 -0
- package/operators/Components.js +140 -0
- package/operators/Components.js.map +1 -0
- package/operators/arithmetic/Avg.d.ts +2 -2
- package/operators/arithmetic/Avg.js +2 -6
- package/operators/arithmetic/Avg.js.map +1 -1
- package/operators/arithmetic/Count.d.ts +2 -2
- package/operators/arithmetic/Count.js +2 -6
- package/operators/arithmetic/Count.js.map +1 -1
- package/operators/arithmetic/Max.d.ts +2 -2
- package/operators/arithmetic/Max.js +2 -6
- package/operators/arithmetic/Max.js.map +1 -1
- package/operators/arithmetic/Min.d.ts +2 -2
- package/operators/arithmetic/Min.js +2 -6
- package/operators/arithmetic/Min.js.map +1 -1
- package/operators/arithmetic/Multiply.d.ts +2 -2
- package/operators/arithmetic/Multiply.js +2 -6
- package/operators/arithmetic/Multiply.js.map +1 -1
- package/operators/arithmetic/Sum.d.ts +2 -2
- package/operators/arithmetic/Sum.js +2 -6
- package/operators/arithmetic/Sum.js.map +1 -1
- package/operators/array/First.d.ts +2 -4
- package/operators/array/First.js +9 -15
- package/operators/array/First.js.map +1 -1
- package/operators/array/Last.d.ts +2 -4
- package/operators/array/Last.js +9 -15
- package/operators/array/Last.js.map +1 -1
- package/operators/array/Map.d.ts +5 -6
- package/operators/array/Map.js +14 -20
- package/operators/array/Map.js.map +1 -1
- package/operators/compare/EqualDesc.d.ts +6 -7
- package/operators/compare/EqualDesc.js +13 -11
- package/operators/compare/EqualDesc.js.map +1 -1
- package/operators/compare/EqualDescLookup.d.ts +2 -2
- package/operators/compare/EqualDescLookup.js +24 -31
- package/operators/compare/EqualDescLookup.js.map +1 -1
- package/operators/compare/GreaterThen.d.ts +3 -4
- package/operators/compare/GreaterThen.js +3 -7
- package/operators/compare/GreaterThen.js.map +1 -1
- package/operators/compare/GreaterThenEqual.d.ts +3 -4
- package/operators/compare/GreaterThenEqual.js +3 -7
- package/operators/compare/GreaterThenEqual.js.map +1 -1
- package/operators/compare/In.d.ts +3 -4
- package/operators/compare/In.js +3 -7
- package/operators/compare/In.js.map +1 -1
- package/operators/compare/IsNotNull.d.ts +3 -3
- package/operators/compare/IsNotNull.js +3 -7
- package/operators/compare/IsNotNull.js.map +1 -1
- package/operators/compare/IsNull.d.ts +3 -3
- package/operators/compare/IsNull.js +3 -7
- package/operators/compare/IsNull.js.map +1 -1
- package/operators/compare/LessThen.d.ts +3 -3
- package/operators/compare/LessThen.js +3 -6
- package/operators/compare/LessThen.js.map +1 -1
- package/operators/compare/LessThenEqual.d.ts +3 -4
- package/operators/compare/LessThenEqual.js +3 -7
- package/operators/compare/LessThenEqual.js.map +1 -1
- package/operators/compare/Like.d.ts +3 -4
- package/operators/compare/Like.js +3 -7
- package/operators/compare/Like.js.map +1 -1
- package/operators/compare/NotEqual.d.ts +3 -4
- package/operators/compare/NotEqual.js +3 -7
- package/operators/compare/NotEqual.js.map +1 -1
- package/operators/compare/NotIn.d.ts +3 -4
- package/operators/compare/NotIn.js +3 -7
- package/operators/compare/NotIn.js.map +1 -1
- package/operators/compare/Regex.d.ts +2 -6
- package/operators/compare/Regex.js +28 -33
- package/operators/compare/Regex.js.map +1 -1
- package/operators/date/Date.d.ts +2 -2
- package/operators/date/Date.js +3 -6
- package/operators/date/Date.js.map +1 -1
- package/operators/date/DateToString.d.ts +4 -5
- package/operators/date/DateToString.js +15 -20
- package/operators/date/DateToString.js.map +1 -1
- package/operators/date/Day.d.ts +2 -2
- package/operators/date/Day.js +2 -6
- package/operators/date/Day.js.map +1 -1
- package/operators/date/Month.d.ts +2 -2
- package/operators/date/Month.js +2 -6
- package/operators/date/Month.js.map +1 -1
- package/operators/date/Year.d.ts +2 -2
- package/operators/date/Year.js +2 -6
- package/operators/date/Year.js.map +1 -1
- package/operators/logic/AndDesc.d.ts +5 -7
- package/operators/logic/AndDesc.js +16 -21
- package/operators/logic/AndDesc.js.map +1 -1
- package/operators/logic/AndDescLookup.d.ts +2 -2
- package/operators/logic/AndDescLookup.js +1 -5
- package/operators/logic/AndDescLookup.js.map +1 -1
- package/operators/logic/NotDesc.d.ts +8 -0
- package/operators/logic/NotDesc.js +21 -0
- package/operators/logic/NotDesc.js.map +1 -0
- package/operators/logic/OrDesc.d.ts +5 -7
- package/operators/logic/OrDesc.js +5 -21
- package/operators/logic/OrDesc.js.map +1 -1
- package/operators/stage/AbstractSection.d.ts +7 -0
- package/operators/stage/AbstractSection.js +11 -0
- package/operators/stage/AbstractSection.js.map +1 -0
- package/operators/stage/Group.d.ts +4 -10
- package/operators/stage/Group.js +33 -39
- package/operators/stage/Group.js.map +1 -1
- package/operators/stage/Limit.d.ts +2 -2
- package/operators/stage/Limit.js +2 -6
- package/operators/stage/Limit.js.map +1 -1
- package/operators/stage/Match.d.ts +2 -8
- package/operators/stage/Match.js +2 -20
- package/operators/stage/Match.js.map +1 -1
- package/operators/stage/Project.d.ts +2 -8
- package/operators/stage/Project.js +17 -21
- package/operators/stage/Project.js.map +1 -1
- package/operators/stage/Query..d.ts +1 -0
- package/operators/stage/Query..js +3 -0
- package/operators/stage/Query..js.map +1 -0
- package/operators/stage/Skip.d.ts +2 -6
- package/operators/stage/Skip.js +6 -11
- package/operators/stage/Skip.js.map +1 -1
- package/operators/stage/Sort.d.ts +2 -6
- package/operators/stage/Sort.js +6 -11
- package/operators/stage/Sort.js.map +1 -1
- package/operators/string/Substr.d.ts +2 -4
- package/operators/string/Substr.js +19 -22
- package/operators/string/Substr.js.map +1 -1
- package/operators/string/ToFloat.d.ts +2 -3
- package/operators/string/ToFloat.js +9 -15
- package/operators/string/ToFloat.js.map +1 -1
- package/operators/string/ToInt.d.ts +2 -3
- package/operators/string/ToInt.js +9 -15
- package/operators/string/ToInt.js.map +1 -1
- package/operators/string/ToLower.d.ts +2 -3
- package/operators/string/ToLower.js +9 -15
- package/operators/string/ToLower.js.map +1 -1
- package/operators/string/ToUpper.d.ts +2 -4
- package/operators/string/ToUpper.js +9 -15
- package/operators/string/ToUpper.js.map +1 -1
- package/package.json +2 -1
- package/walker/lookup/ILookupFn.d.ts +2 -2
- package/walker/lookup/ILookupFn.js +1 -2
- package/walker/lookup/LookupWalker.d.ts +11 -11
- package/walker/lookup/LookupWalker.js +19 -23
- package/walker/lookup/LookupWalker.js.map +1 -1
- package/IMangoWalker.d.ts +0 -19
- package/IMangoWalker.js +0 -3
- package/IMangoWalker.js.map +0 -1
- package/MangoExpression.d.ts +0 -15
- package/MangoExpression.js +0 -88
- package/MangoExpression.js.map +0 -1
- package/ast/PAst.d.ts +0 -42
- package/ast/PAst.js +0 -158
- package/ast/PAst.js.map +0 -1
- package/ast/PValue.d.ts +0 -10
- package/ast/PValue.js +0 -22
- package/ast/PValue.js.map +0 -1
- package/ast/Value.d.ts +0 -3
- package/ast/Value.js +0 -8
- package/ast/Value.js.map +0 -1
- package/ast/ValueRef.d.ts +0 -4
- package/ast/ValueRef.js +0 -11
- package/ast/ValueRef.js.map +0 -1
- package/operators/Operators.d.ts +0 -35
- package/operators/Operators.js +0 -149
- package/operators/Operators.js.map +0 -1
- package/operators/compare/AbstractCompare.d.ts +0 -5
- package/operators/compare/AbstractCompare.js +0 -14
- package/operators/compare/AbstractCompare.js.map +0 -1
- package/operators/logic/AbstractLogic.d.ts +0 -3
- package/operators/logic/AbstractLogic.js +0 -8
- package/operators/logic/AbstractLogic.js.map +0 -1
- package/operators/logic/Not.d.ts +0 -8
- package/operators/logic/Not.js +0 -22
- package/operators/logic/Not.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AbstractOperator } from '../AbstractOperator';
|
|
2
|
-
export declare class ToInt extends AbstractOperator
|
|
1
|
+
import { AbstractOperator } from '../AbstractOperator.js';
|
|
2
|
+
export declare class ToInt extends AbstractOperator {
|
|
3
3
|
static NAME: string;
|
|
4
4
|
name: string;
|
|
5
|
-
validate(def: any): boolean;
|
|
6
5
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ToInt = void 0;
|
|
4
|
-
const AbstractOperator_1 = require("../AbstractOperator");
|
|
5
|
-
const Context_1 = require("../../ast/Context");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
class ToInt extends AbstractOperator_1.AbstractOperator {
|
|
1
|
+
import { AbstractOperator } from '../AbstractOperator.js';
|
|
2
|
+
export class ToInt extends AbstractOperator {
|
|
8
3
|
constructor() {
|
|
9
4
|
super(...arguments);
|
|
10
5
|
this.name = ToInt.NAME;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
// validate(def: any): boolean {
|
|
7
|
+
// if (isString(def)) {
|
|
8
|
+
// this.value = this.getRootExpression().interprete(def, this, new Context(this.getKeyString()));
|
|
9
|
+
// return true;
|
|
10
|
+
// }
|
|
11
|
+
// return false;
|
|
12
|
+
// }
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
|
-
exports.ToInt = ToInt;
|
|
21
15
|
ToInt.NAME = 'toInt';
|
|
22
16
|
//# sourceMappingURL=ToInt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToInt.js","sourceRoot":"","sources":["../../../../src/operators/string/ToInt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToInt.js","sourceRoot":"","sources":["../../../../src/operators/string/ToInt.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAIxD,MAAM,OAAO,KAAM,SAAQ,gBAAgB;IAA3C;;QAIE,SAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAElB,gCAAgC;QAChC,yBAAyB;QACzB,qGAAqG;QACrG,mBAAmB;QACnB,MAAM;QACN,kBAAkB;QAClB,IAAI;IAEN,CAAC;;AAZQ,UAAI,GAAG,OAAO,AAAV,CAAW"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AbstractOperator } from '../AbstractOperator';
|
|
2
|
-
export declare class ToLower extends AbstractOperator
|
|
1
|
+
import { AbstractOperator } from '../AbstractOperator.js';
|
|
2
|
+
export declare class ToLower extends AbstractOperator {
|
|
3
3
|
static NAME: string;
|
|
4
4
|
name: string;
|
|
5
5
|
args: any[];
|
|
6
|
-
validate(def: any): boolean;
|
|
7
6
|
}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ToLower = void 0;
|
|
4
|
-
const AbstractOperator_1 = require("../AbstractOperator");
|
|
5
|
-
const Context_1 = require("../../ast/Context");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
class ToLower extends AbstractOperator_1.AbstractOperator {
|
|
1
|
+
import { AbstractOperator } from '../AbstractOperator.js';
|
|
2
|
+
export class ToLower extends AbstractOperator {
|
|
8
3
|
constructor() {
|
|
9
4
|
super(...arguments);
|
|
10
5
|
this.name = ToLower.NAME;
|
|
11
6
|
this.args = [];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
// validate(def: any): boolean {
|
|
8
|
+
// if (isString(def)) {
|
|
9
|
+
// this.value = this.getRootExpression().interprete(def, this, new Context(this.getKeyString()));
|
|
10
|
+
// return true;
|
|
11
|
+
// }
|
|
12
|
+
// return false;
|
|
13
|
+
// }
|
|
19
14
|
}
|
|
20
15
|
}
|
|
21
|
-
exports.ToLower = ToLower;
|
|
22
16
|
ToLower.NAME = 'toLower';
|
|
23
17
|
//# sourceMappingURL=ToLower.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToLower.js","sourceRoot":"","sources":["../../../../src/operators/string/ToLower.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToLower.js","sourceRoot":"","sources":["../../../../src/operators/string/ToLower.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAKxD,MAAM,OAAO,OAAQ,SAAQ,gBAAgB;IAA7C;;QAIE,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEpB,SAAI,GAAU,EAAE,CAAC;QAGjB,gCAAgC;QAChC,yBAAyB;QACzB,qGAAqG;QACrG,mBAAmB;QACnB,MAAM;QACN,kBAAkB;QAClB,IAAI;IAEN,CAAC;;AAfQ,YAAI,GAAG,SAAS,AAAZ,CAAa"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { AbstractOperator } from '../AbstractOperator';
|
|
2
|
-
|
|
3
|
-
export declare class ToUpper extends AbstractOperator<PAst<any>> {
|
|
1
|
+
import { AbstractOperator } from '../AbstractOperator.js';
|
|
2
|
+
export declare class ToUpper extends AbstractOperator {
|
|
4
3
|
static NAME: string;
|
|
5
4
|
name: string;
|
|
6
|
-
validate(def: any): boolean;
|
|
7
5
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ToUpper = void 0;
|
|
4
|
-
const AbstractOperator_1 = require("../AbstractOperator");
|
|
5
|
-
const Context_1 = require("../../ast/Context");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
class ToUpper extends AbstractOperator_1.AbstractOperator {
|
|
1
|
+
import { AbstractOperator } from '../AbstractOperator.js';
|
|
2
|
+
export class ToUpper extends AbstractOperator {
|
|
8
3
|
constructor() {
|
|
9
4
|
super(...arguments);
|
|
10
5
|
this.name = ToUpper.NAME;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
// validate(def: any): boolean {
|
|
7
|
+
// if (isString(def)) {
|
|
8
|
+
// this.value = this.getRootExpression().interprete(def, this, new Context(this.getKeyString()));
|
|
9
|
+
// return true;
|
|
10
|
+
// }
|
|
11
|
+
// return false;
|
|
12
|
+
// }
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
|
-
exports.ToUpper = ToUpper;
|
|
21
15
|
ToUpper.NAME = 'toUpper';
|
|
22
16
|
//# sourceMappingURL=ToUpper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToUpper.js","sourceRoot":"","sources":["../../../../src/operators/string/ToUpper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToUpper.js","sourceRoot":"","sources":["../../../../src/operators/string/ToUpper.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAKxD,MAAM,OAAO,OAAQ,SAAQ,gBAAgB;IAA7C;;QAGE,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEpB,gCAAgC;QAChC,yBAAyB;QACzB,qGAAqG;QACrG,mBAAmB;QACnB,MAAM;QACN,kBAAkB;QAClB,IAAI;IAEN,CAAC;;AAZQ,YAAI,GAAG,SAAS,AAAZ,CAAa"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Expr } from '../../ast/Expr.js';
|
|
2
2
|
export interface ILookupFn {
|
|
3
|
-
lookup(ast:
|
|
3
|
+
lookup(ast: Expr, source?: any): (target: any, source?: any) => boolean;
|
|
4
4
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare class LookupWalker implements
|
|
1
|
+
import { IWalker, IWalkerControl } from '../../IWalker.js';
|
|
2
|
+
import { Expr } from '../../ast/Expr.js';
|
|
3
|
+
export declare class LookupWalker implements IWalker {
|
|
4
4
|
source: any;
|
|
5
5
|
constructor(source?: any);
|
|
6
|
-
visitArray(ast:
|
|
7
|
-
leaveArray(res: any[], ast:
|
|
8
|
-
visitObject(ast:
|
|
9
|
-
leaveObject(res: any, ast:
|
|
10
|
-
visitOperator(ast:
|
|
11
|
-
leaveOperator(res: any, ast:
|
|
12
|
-
onOperator(ast:
|
|
13
|
-
onValue(ast:
|
|
6
|
+
visitArray(ast: Expr, ctrl?: IWalkerControl): any[];
|
|
7
|
+
leaveArray(res: any[], ast: Expr): any;
|
|
8
|
+
visitObject(ast: Expr, ctrl?: IWalkerControl): any;
|
|
9
|
+
leaveObject(res: any, ast: Expr): any;
|
|
10
|
+
visitOperator(ast: Expr, ctrl?: IWalkerControl): any;
|
|
11
|
+
leaveOperator(res: any, ast: Expr): any;
|
|
12
|
+
onOperator(ast: Expr, valueRes: any, ctrl?: IWalkerControl): any;
|
|
13
|
+
onValue(ast: Expr, ctrl?: IWalkerControl): any;
|
|
14
14
|
combineFunction(_values: Function[]): any;
|
|
15
15
|
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const AndDesc_1 = require("../../operators/logic/AndDesc");
|
|
10
|
-
const AndDescLookup_1 = require("../../operators/logic/AndDescLookup");
|
|
11
|
-
const bindings = new Bindings_1.Bindings('lookup');
|
|
1
|
+
import { isUndefined, values } from '@allgemein/base';
|
|
2
|
+
import { ClassUtils, NotSupportedError } from '@allgemein/base';
|
|
3
|
+
import { Bindings } from '../../ast/Bindings.js';
|
|
4
|
+
import { EqualDesc } from '../../operators/compare/EqualDesc.js';
|
|
5
|
+
import { EqualDescLookup } from '../../operators/compare/EqualDescLookup.js';
|
|
6
|
+
import { AndDesc } from '../../operators/logic/AndDesc.js';
|
|
7
|
+
import { AndDescLookup } from '../../operators/logic/AndDescLookup.js';
|
|
8
|
+
const bindings = new Bindings('lookup');
|
|
12
9
|
bindings.list.push({
|
|
13
|
-
on:
|
|
14
|
-
use:
|
|
10
|
+
on: EqualDesc,
|
|
11
|
+
use: EqualDescLookup
|
|
15
12
|
});
|
|
16
13
|
bindings.list.push({
|
|
17
|
-
on:
|
|
18
|
-
use:
|
|
14
|
+
on: AndDesc,
|
|
15
|
+
use: AndDescLookup
|
|
19
16
|
});
|
|
20
|
-
class LookupWalker {
|
|
17
|
+
export class LookupWalker {
|
|
21
18
|
constructor(source) {
|
|
22
19
|
this.source = source;
|
|
23
20
|
}
|
|
@@ -25,7 +22,7 @@ class LookupWalker {
|
|
|
25
22
|
return [];
|
|
26
23
|
}
|
|
27
24
|
leaveArray(res, ast) {
|
|
28
|
-
const _values =
|
|
25
|
+
const _values = values(res);
|
|
29
26
|
if (_values.length > 1) {
|
|
30
27
|
return this.combineFunction(_values);
|
|
31
28
|
}
|
|
@@ -37,7 +34,7 @@ class LookupWalker {
|
|
|
37
34
|
return {};
|
|
38
35
|
}
|
|
39
36
|
leaveObject(res, ast) {
|
|
40
|
-
const _values =
|
|
37
|
+
const _values = values(res);
|
|
41
38
|
if (_values.length > 1) {
|
|
42
39
|
return this.combineFunction(_values);
|
|
43
40
|
}
|
|
@@ -51,11 +48,11 @@ class LookupWalker {
|
|
|
51
48
|
return res;
|
|
52
49
|
}
|
|
53
50
|
onOperator(ast, valueRes, ctrl) {
|
|
54
|
-
const cls =
|
|
51
|
+
const cls = ClassUtils.getFunction(ast);
|
|
55
52
|
const overlay = bindings.list.find(x => x.on === cls);
|
|
56
53
|
if (overlay) {
|
|
57
54
|
const i = Reflect.construct(overlay.use, []);
|
|
58
|
-
if (
|
|
55
|
+
if (isUndefined(this.source)) {
|
|
59
56
|
return i.lookup(ast);
|
|
60
57
|
}
|
|
61
58
|
else {
|
|
@@ -63,14 +60,14 @@ class LookupWalker {
|
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
else {
|
|
66
|
-
throw new
|
|
63
|
+
throw new NotSupportedError('');
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
onValue(ast, ctrl) {
|
|
70
67
|
}
|
|
71
68
|
combineFunction(_values) {
|
|
72
69
|
let fn = null;
|
|
73
|
-
if (
|
|
70
|
+
if (isUndefined(this.source)) {
|
|
74
71
|
fn = (function (values) {
|
|
75
72
|
return function (target, source) {
|
|
76
73
|
let x = true && values.length > 0;
|
|
@@ -95,5 +92,4 @@ class LookupWalker {
|
|
|
95
92
|
return fn;
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
|
-
exports.LookupWalker = LookupWalker;
|
|
99
95
|
//# sourceMappingURL=LookupWalker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookupWalker.js","sourceRoot":"","sources":["../../../../src/walker/lookup/LookupWalker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LookupWalker.js","sourceRoot":"","sources":["../../../../src/walker/lookup/LookupWalker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,SAAS,EAAC,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAC,eAAe,EAAC,MAAM,4CAA4C,CAAC;AAE3E,OAAO,EAAC,OAAO,EAAC,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AAErE,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IACjB,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,eAAe;CACrB,CAAC,CAAC;AACH,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IACjB,EAAE,EAAE,OAAO;IACX,GAAG,EAAE,aAAa;CACnB,CAAC,CAAC;AAEH,MAAM,OAAO,YAAY;IAKvB,YAAY,MAAY;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,CAAC,GAAS,EAAE,IAAqB;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AC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CAEF"}
|
package/IMangoWalker.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PAst } from './ast/PAst';
|
|
2
|
-
export interface IMangoWalkerControl {
|
|
3
|
-
abort?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface IMangoWalker {
|
|
6
|
-
/**
|
|
7
|
-
* return the array
|
|
8
|
-
*
|
|
9
|
-
* @param ast
|
|
10
|
-
*/
|
|
11
|
-
visitArray(ast: PAst<any>, ctrl?: IMangoWalkerControl): any[];
|
|
12
|
-
leaveArray(res: any[], ast: PAst<any>): any;
|
|
13
|
-
visitObject(ast: PAst<any>, ctrl?: IMangoWalkerControl): any;
|
|
14
|
-
leaveObject(res: any, ast: PAst<any>): any;
|
|
15
|
-
onValue(ast: PAst<any>, ctrl?: IMangoWalkerControl): any;
|
|
16
|
-
onOperator(ast: PAst<any>, valueRes: any, ctrl?: IMangoWalkerControl): any;
|
|
17
|
-
visitOperator(ast: PAst<any>, ctrl?: IMangoWalkerControl): any;
|
|
18
|
-
leaveOperator(res: any, ast: PAst<any>): any;
|
|
19
|
-
}
|
package/IMangoWalker.js
DELETED
package/IMangoWalker.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IMangoWalker.js","sourceRoot":"","sources":["../../src/IMangoWalker.ts"],"names":[],"mappings":""}
|
package/MangoExpression.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PAst } from './ast/PAst';
|
|
2
|
-
import { IMangoWalker } from './IMangoWalker';
|
|
3
|
-
import { Context } from './ast/Context';
|
|
4
|
-
import { ClassType } from '@allgemein/schema-api';
|
|
5
|
-
export declare class MangoExpression {
|
|
6
|
-
readonly root: PAst<any>;
|
|
7
|
-
constructor(def: any);
|
|
8
|
-
getByKey(key: string): PAst<any>;
|
|
9
|
-
getRoot(): PAst<any>;
|
|
10
|
-
interprete(def: any, p?: PAst<any>, ctxt?: Context): PAst<any>;
|
|
11
|
-
getOperator(operatorKey: string, operatorValue: any, def: any, parent: PAst<any>, context: Context): import(".").AbstractOperator<any>;
|
|
12
|
-
create<X extends PAst<any>>(root: ClassType<X>, def: any, p?: PAst<any>, ctxt?: Context): X;
|
|
13
|
-
visit(o: IMangoWalker): any;
|
|
14
|
-
toJson(): any;
|
|
15
|
-
}
|
package/MangoExpression.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MangoExpression = void 0;
|
|
4
|
-
const ValueRef_1 = require("./ast/ValueRef");
|
|
5
|
-
const Value_1 = require("./ast/Value");
|
|
6
|
-
const PArray_1 = require("./ast/PArray");
|
|
7
|
-
const PObject_1 = require("./ast/PObject");
|
|
8
|
-
const Operators_1 = require("./operators/Operators");
|
|
9
|
-
const Context_1 = require("./ast/Context");
|
|
10
|
-
const Constants_1 = require("./Constants");
|
|
11
|
-
const lodash_1 = require("lodash");
|
|
12
|
-
class MangoExpression {
|
|
13
|
-
constructor(def) {
|
|
14
|
-
this.root = null;
|
|
15
|
-
// default change object assignment to value
|
|
16
|
-
const ctxt = new Context_1.Context();
|
|
17
|
-
ctxt.set(Constants_1.AUTO_EQUAL_CONV_SUPPORT, true);
|
|
18
|
-
this.root = this.interprete(def, null, ctxt);
|
|
19
|
-
}
|
|
20
|
-
getByKey(key) {
|
|
21
|
-
return this.root.getByKey(key);
|
|
22
|
-
}
|
|
23
|
-
getRoot() {
|
|
24
|
-
return this.root;
|
|
25
|
-
}
|
|
26
|
-
interprete(def, p, ctxt) {
|
|
27
|
-
const context = ctxt ? ctxt : new Context_1.Context();
|
|
28
|
-
if (p) {
|
|
29
|
-
context.key = ctxt.key;
|
|
30
|
-
context.merge(p.getContext());
|
|
31
|
-
}
|
|
32
|
-
let result = null;
|
|
33
|
-
if ((0, lodash_1.isString)(def) ||
|
|
34
|
-
(0, lodash_1.isNumber)(def) ||
|
|
35
|
-
(0, lodash_1.isDate)(def) ||
|
|
36
|
-
(0, lodash_1.isNull)(def) ||
|
|
37
|
-
(0, lodash_1.isBoolean)(def)) {
|
|
38
|
-
const isRef = (0, lodash_1.isString)(def) && def.match(/^\$(.+)/);
|
|
39
|
-
if (isRef) {
|
|
40
|
-
result = this.create(ValueRef_1.ValueRef, isRef[1], p, context);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
result = this.create(Value_1.Value, def, p, context);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else if ((0, lodash_1.isArray)(def)) {
|
|
47
|
-
result = this.create(PArray_1.PArray, def, p, context);
|
|
48
|
-
}
|
|
49
|
-
else if ((0, lodash_1.isObjectLike)(def)) {
|
|
50
|
-
const k = Object.keys(def);
|
|
51
|
-
// TODO make multiple $registry work
|
|
52
|
-
const operators = k.filter(x => /^\$/.test(x) && Operators_1.Operators.has(x.substr(1)));
|
|
53
|
-
if (operators.length === 1) {
|
|
54
|
-
const operatorKey = operators[0];
|
|
55
|
-
const follow = def[operatorKey];
|
|
56
|
-
result = this.getOperator(operatorKey, follow, def, p, context);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
result = this.create(PObject_1.PObject, def, p, context);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (!result) {
|
|
63
|
-
throw new Error(`not yet implemented for ${def}`);
|
|
64
|
-
}
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
getOperator(operatorKey, operatorValue, def, parent, context) {
|
|
68
|
-
const operator = Operators_1.Operators.create(operatorKey, this, parent, context);
|
|
69
|
-
operator.interprete(this, operatorValue, parent, context);
|
|
70
|
-
// if (!operator.validate(operatorValue, def)) {
|
|
71
|
-
// throw new Error(`operator ${operatorKey} has no valid definition ${JSON.stringify(def)}`);
|
|
72
|
-
// }
|
|
73
|
-
return operator;
|
|
74
|
-
}
|
|
75
|
-
create(root, def, p, ctxt) {
|
|
76
|
-
const x = Reflect.construct(root, []);
|
|
77
|
-
x.interprete(this, def, p, ctxt);
|
|
78
|
-
return x;
|
|
79
|
-
}
|
|
80
|
-
visit(o) {
|
|
81
|
-
return this.root.visit(o);
|
|
82
|
-
}
|
|
83
|
-
toJson() {
|
|
84
|
-
return this.root.toJson();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.MangoExpression = MangoExpression;
|
|
88
|
-
//# sourceMappingURL=MangoExpression.js.map
|
package/MangoExpression.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MangoExpression.js","sourceRoot":"","sources":["../../src/MangoExpression.ts"],"names":[],"mappings":";;;AAEA,6CAAwC;AACxC,uCAAkC;AAClC,yCAAoC;AACpC,2CAAsC;AACtC,qDAAgD;AAEhD,2CAAsC;AACtC,2CAAoD;AAEpD,mCAA4F;AAE5F,MAAa,eAAe;IAI1B,YAAY,GAAQ;QAFX,SAAI,GAAc,IAAI,CAAC;QAG9B,4CAA4C;QAC5C,MAAM,IAAI,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,GAAG,CAAC,mCAAuB,EAAE,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAGD,UAAU,CAAC,GAAQ,EAAE,CAAa,EAAE,IAAc;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,iBAAO,EAAE,CAAC;QAC5C,IAAI,CAAC,EAAE,CAAC;YACN,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,GAA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C,CAAC,CAAC,CAAC;IAC5B,CAAC;IAID,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CAEF;AAzFD,0CAyFC"}
|
package/ast/PAst.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { MangoExpression } from '../MangoExpression';
|
|
2
|
-
import { IMangoWalker } from '../IMangoWalker';
|
|
3
|
-
import { Context } from './Context';
|
|
4
|
-
export declare abstract class PAst<X> {
|
|
5
|
-
private rootExpression;
|
|
6
|
-
parent: PAst<any>;
|
|
7
|
-
key: string | number | PAst<string>;
|
|
8
|
-
context: Context;
|
|
9
|
-
value: X;
|
|
10
|
-
interprete(e: MangoExpression, value: X, p?: PAst<any>, ctxt?: Context): void;
|
|
11
|
-
enviroment(e: MangoExpression, p?: PAst<any>, ctxt?: Context): void;
|
|
12
|
-
getKey(): string | number | PAst<string>;
|
|
13
|
-
setKey(key: string | PAst<string>): void;
|
|
14
|
-
getKeyString(): string | number;
|
|
15
|
-
getValue(): X;
|
|
16
|
-
setValue(v: X): void;
|
|
17
|
-
applyParent(v: X): void;
|
|
18
|
-
getRootExpression(): MangoExpression;
|
|
19
|
-
setRootExpression(base: MangoExpression): void;
|
|
20
|
-
getParentExpression(): PAst<any>;
|
|
21
|
-
setParentExpression(base: PAst<any>): void;
|
|
22
|
-
getContext(): Context;
|
|
23
|
-
mergeWith(ctxt: Context): void;
|
|
24
|
-
keys(): (string | number)[];
|
|
25
|
-
/**
|
|
26
|
-
* function execute on self and parents
|
|
27
|
-
*
|
|
28
|
-
* @param fn
|
|
29
|
-
* @param self
|
|
30
|
-
*/
|
|
31
|
-
backwardCall(fn: (x: PAst<any>) => boolean, self?: boolean): any;
|
|
32
|
-
/**
|
|
33
|
-
* check if the self or nodes branch is in some sublying context
|
|
34
|
-
*
|
|
35
|
-
* @param ctxt
|
|
36
|
-
* @param selfCheck
|
|
37
|
-
*/
|
|
38
|
-
isInContext(ctxt: string, selfCheck?: boolean): boolean;
|
|
39
|
-
abstract getByKey(key: string): PAst<any>;
|
|
40
|
-
abstract visit(o: IMangoWalker): any;
|
|
41
|
-
toJson(): any;
|
|
42
|
-
}
|