3xpr 1.10.5 → 1.11.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/__tests__/auto/comparison.test.js +2 -1
- package/__tests__/auto/comparison.test.js.map +1 -1
- package/__tests__/auto/parameters.test.js +1 -0
- package/__tests__/auto/parameters.test.js.map +1 -1
- package/__tests__/auto/string.test.js +5 -0
- package/__tests__/auto/string.test.js.map +1 -1
- package/__tests__/auto/type.test.js +1 -0
- package/__tests__/auto/type.test.js.map +1 -1
- package/{infrastructure/expression → expression/application}/expressions.d.ts +14 -20
- package/{infrastructure/expression → expression/application}/expressions.js +47 -43
- package/expression/application/expressions.js.map +1 -0
- package/expression/application/index.d.ts +6 -0
- package/expression/application/index.js +23 -0
- package/expression/application/index.js.map +1 -0
- package/expression/application/ports/converter.d.ts +3 -0
- package/expression/application/ports/converter.js +3 -0
- package/expression/application/ports/converter.js.map +1 -0
- package/expression/application/services/builder.d.ts +13 -0
- package/expression/application/services/builder.js +29 -0
- package/expression/application/services/builder.js.map +1 -0
- package/{application/expression/useCases/normalize.d.ts → expression/application/services/normalizer.d.ts} +1 -1
- package/{application/expression/useCases/normalize.js → expression/application/services/normalizer.js} +4 -4
- package/expression/application/services/normalizer.js.map +1 -0
- package/{application/expression → expression/application}/services/parser.d.ts +6 -1
- package/{application/expression → expression/application}/services/parser.js +21 -2
- package/expression/application/services/parser.js.map +1 -0
- package/expression/application/useCases/build.d.ts +8 -0
- package/expression/application/useCases/build.js +50 -0
- package/expression/application/useCases/build.js.map +1 -0
- package/expression/application/useCases/convert.d.ts +5 -0
- package/expression/application/useCases/convert.js +31 -0
- package/expression/application/useCases/convert.js.map +1 -0
- package/{application/ports → expression/domain}/expressions.d.ts +5 -6
- package/expression/domain/expressions.js.map +1 -0
- package/expression/domain/index.d.ts +1 -0
- package/{application/helper → expression/domain}/index.js +1 -2
- package/expression/domain/index.js.map +1 -0
- package/expression/infrastructure/convertFromFunction.d.ts +10 -0
- package/expression/infrastructure/convertFromFunction.js +58 -0
- package/expression/infrastructure/convertFromFunction.js.map +1 -0
- package/expression/infrastructure/convertFromGraphql.d.ts +4 -0
- package/{infrastructure/expression → expression/infrastructure}/convertFromGraphql.js +14 -4
- package/expression/infrastructure/convertFromGraphql.js.map +1 -0
- package/expression/infrastructure/helper.d.ts +5 -0
- package/expression/infrastructure/helper.js +47 -0
- package/expression/infrastructure/helper.js.map +1 -0
- package/expression/infrastructure/index.d.ts +1 -0
- package/{application → expression/infrastructure}/index.js +4 -4
- package/expression/infrastructure/index.js.map +1 -0
- package/{application/model → expression/infrastructure}/library.d.ts +2 -4
- package/{application/model → expression/infrastructure}/library.js +111 -94
- package/expression/infrastructure/library.js.map +1 -0
- package/index.d.ts +30 -3
- package/index.js +50 -3
- package/index.js.map +1 -1
- package/{application/model → model/application}/index.d.ts +0 -1
- package/{application/model → model/application}/index.js +0 -1
- package/model/application/index.js.map +1 -0
- package/{application/model → model/application}/modelService.d.ts +3 -1
- package/{application/model → model/application}/modelService.js +1 -2
- package/model/application/modelService.js.map +1 -0
- package/model/domain/index.d.ts +1 -0
- package/{application/operand/useCases/build/factory → model/domain}/index.js +1 -2
- package/model/domain/index.js.map +1 -0
- package/{domain/model → model/domain}/services.d.ts +2 -2
- package/model/domain/services.js.map +1 -0
- package/operand/application/index.d.ts +8 -0
- package/{application/operand → operand/application}/index.js +6 -8
- package/operand/application/index.js.map +1 -0
- package/operand/application/services/constBuilder.d.ts +4 -0
- package/operand/application/services/constBuilder.js +3 -0
- package/operand/application/services/constBuilder.js.map +1 -0
- package/operand/application/services/factory.d.ts +8 -0
- package/operand/application/services/factory.js +25 -0
- package/operand/application/services/factory.js.map +1 -0
- package/operand/application/services/parameterService.d.ts +4 -0
- package/{application/operand → operand/application}/services/parameterService.js +1 -1
- package/{application/operand → operand/application}/services/parameterService.js.map +1 -1
- package/{application/operand/useCases → operand/application/services}/serializer.d.ts +1 -1
- package/{application/operand/useCases → operand/application/services}/serializer.js +1 -1
- package/{application/operand/useCases → operand/application/services}/serializer.js.map +1 -1
- package/{application/operand → operand/application}/services/typeService.d.ts +7 -4
- package/{application/operand → operand/application}/services/typeService.js +74 -11
- package/operand/application/services/typeService.js.map +1 -0
- package/operand/application/useCases/clone.d.ts +7 -0
- package/operand/application/useCases/clone.js +39 -0
- package/operand/application/useCases/clone.js.map +1 -0
- package/operand/application/useCases/complete.d.ts +7 -0
- package/operand/application/useCases/complete.js +40 -0
- package/operand/application/useCases/complete.js.map +1 -0
- package/operand/application/useCases/normalize.d.ts +6 -0
- package/{application/operand/useCases/normalizer.js → operand/application/useCases/normalize.js} +16 -7
- package/operand/application/useCases/normalize.js.map +1 -0
- package/operand/application/useCases/reduce.d.ts +7 -0
- package/{application/operand/useCases/reducer.js → operand/application/useCases/reduce.js} +21 -9
- package/operand/application/useCases/reduce.js.map +1 -0
- package/{domain/operand → operand/domain}/entities.d.ts +4 -49
- package/operand/domain/entities.js +19 -0
- package/operand/domain/entities.js.map +1 -0
- package/operand/domain/index.d.ts +2 -0
- package/{domain → operand/domain}/index.js +1 -3
- package/operand/domain/index.js.map +1 -0
- package/operand/domain/services.d.ts +8 -0
- package/operand/domain/services.js.map +1 -0
- package/operand/infrastructure/constBuilder.d.ts +4 -0
- package/operand/infrastructure/constBuilder.js +25 -0
- package/operand/infrastructure/constBuilder.js.map +1 -0
- package/operand/infrastructure/evaluators/async.d.ts +119 -0
- package/operand/infrastructure/evaluators/async.js +560 -0
- package/operand/infrastructure/evaluators/async.js.map +1 -0
- package/operand/infrastructure/evaluators/sync.d.ts +110 -0
- package/operand/infrastructure/evaluators/sync.js +485 -0
- package/operand/infrastructure/evaluators/sync.js.map +1 -0
- package/operand/infrastructure/helper.d.ts +18 -0
- package/{application/helper/operandHelper.js → operand/infrastructure/helper.js} +23 -8
- package/operand/infrastructure/helper.js.map +1 -0
- package/operand/infrastructure/index.d.ts +2 -0
- package/operand/infrastructure/index.js +23 -0
- package/operand/infrastructure/index.js.map +1 -0
- package/package.json +2 -2
- package/shared/application/helper/expression.d.ts +3 -0
- package/shared/application/helper/expression.js +3 -0
- package/shared/application/helper/expression.js.map +1 -0
- package/shared/application/helper/helper.d.ts +7 -0
- package/shared/application/helper/helper.js +25 -0
- package/shared/application/helper/helper.js.map +1 -0
- package/{application/helper/operandHelper.d.ts → shared/application/helper/operand.d.ts} +1 -2
- package/shared/application/helper/operand.js +3 -0
- package/shared/application/helper/operand.js.map +1 -0
- package/shared/application/index.d.ts +3 -0
- package/{application/expression → shared/application}/index.js +3 -3
- package/shared/application/index.js.map +1 -0
- package/shared/domain/base.js.map +1 -0
- package/shared/domain/context.js.map +1 -0
- package/{domain/entities → shared/domain}/index.d.ts +1 -0
- package/{domain/entities → shared/domain}/index.js +1 -0
- package/shared/domain/index.js.map +1 -0
- package/{domain/entities → shared/domain}/observer.d.ts +1 -1
- package/shared/domain/observer.js.map +1 -0
- package/shared/domain/operand.d.ts +50 -0
- package/{domain/operand/entities.js → shared/domain/operand.js} +2 -17
- package/shared/domain/operand.js.map +1 -0
- package/shared/domain/signals.js.map +1 -0
- package/application/expression/index.d.ts +0 -3
- package/application/expression/index.js.map +0 -1
- package/application/expression/services/parser.js.map +0 -1
- package/application/expression/useCases/normalize.js.map +0 -1
- package/application/expression/useCases/parse.d.ts +0 -6
- package/application/expression/useCases/parse.js +0 -15
- package/application/expression/useCases/parse.js.map +0 -1
- package/application/helper/helper.d.ts +0 -13
- package/application/helper/helper.js +0 -45
- package/application/helper/helper.js.map +0 -1
- package/application/helper/index.d.ts +0 -2
- package/application/helper/index.js.map +0 -1
- package/application/helper/operandHelper.js.map +0 -1
- package/application/index.d.ts +0 -5
- package/application/index.js.map +0 -1
- package/application/model/index.js.map +0 -1
- package/application/model/library.js.map +0 -1
- package/application/model/modelService.js.map +0 -1
- package/application/operand/index.d.ts +0 -10
- package/application/operand/index.js.map +0 -1
- package/application/operand/services/operandService.d.ts +0 -13
- package/application/operand/services/operandService.js +0 -62
- package/application/operand/services/operandService.js.map +0 -1
- package/application/operand/services/parameterService.d.ts +0 -4
- package/application/operand/services/typeService.js.map +0 -1
- package/application/operand/useCases/build/basicOperandBuilder.d.ts +0 -6
- package/application/operand/useCases/build/basicOperandBuilder.js +0 -15
- package/application/operand/useCases/build/basicOperandBuilder.js.map +0 -1
- package/application/operand/useCases/build/factory/basic/evaluators.d.ts +0 -67
- package/application/operand/useCases/build/factory/basic/evaluators.js +0 -239
- package/application/operand/useCases/build/factory/basic/evaluators.js.map +0 -1
- package/application/operand/useCases/build/factory/basic/factory.d.ts +0 -11
- package/application/operand/useCases/build/factory/basic/factory.js +0 -128
- package/application/operand/useCases/build/factory/basic/factory.js.map +0 -1
- package/application/operand/useCases/build/factory/index.d.ts +0 -2
- package/application/operand/useCases/build/factory/index.js.map +0 -1
- package/application/operand/useCases/build/factory/process/evaluators.d.ts +0 -58
- package/application/operand/useCases/build/factory/process/evaluators.js +0 -317
- package/application/operand/useCases/build/factory/process/evaluators.js.map +0 -1
- package/application/operand/useCases/build/factory/process/factory.d.ts +0 -8
- package/application/operand/useCases/build/factory/process/factory.js +0 -122
- package/application/operand/useCases/build/factory/process/factory.js.map +0 -1
- package/application/operand/useCases/build/operandBuilder.d.ts +0 -15
- package/application/operand/useCases/build/operandBuilder.js +0 -46
- package/application/operand/useCases/build/operandBuilder.js.map +0 -1
- package/application/operand/useCases/build/processOperandBuilder.d.ts +0 -6
- package/application/operand/useCases/build/processOperandBuilder.js +0 -15
- package/application/operand/useCases/build/processOperandBuilder.js.map +0 -1
- package/application/operand/useCases/normalizer.d.ts +0 -7
- package/application/operand/useCases/normalizer.js.map +0 -1
- package/application/operand/useCases/reducer.d.ts +0 -7
- package/application/operand/useCases/reducer.js.map +0 -1
- package/application/ports/expressions.js.map +0 -1
- package/domain/entities/base.js.map +0 -1
- package/domain/entities/context.js.map +0 -1
- package/domain/entities/index.js.map +0 -1
- package/domain/entities/observer.js.map +0 -1
- package/domain/entities/signals.js.map +0 -1
- package/domain/index.d.ts +0 -4
- package/domain/index.js.map +0 -1
- package/domain/model/services.js.map +0 -1
- package/domain/operand/entities.js.map +0 -1
- package/domain/operand/services.d.ts +0 -23
- package/domain/operand/services.js.map +0 -1
- package/infrastructure/expression/builder.d.ts +0 -5
- package/infrastructure/expression/builder.js +0 -18
- package/infrastructure/expression/builder.js.map +0 -1
- package/infrastructure/expression/convertFromFunction.d.ts +0 -11
- package/infrastructure/expression/convertFromFunction.js +0 -45
- package/infrastructure/expression/convertFromFunction.js.map +0 -1
- package/infrastructure/expression/convertFromGraphql.d.ts +0 -3
- package/infrastructure/expression/convertFromGraphql.js.map +0 -1
- package/infrastructure/expression/expressions.js.map +0 -1
- package/infrastructure/index.d.ts +0 -19
- package/infrastructure/index.js +0 -52
- package/infrastructure/index.js.map +0 -1
- /package/{application/ports → expression/domain}/expressions.js +0 -0
- /package/{domain/model → model/domain}/services.js +0 -0
- /package/{domain/operand → operand/domain}/services.js +0 -0
- /package/{domain/entities → shared/domain}/base.d.ts +0 -0
- /package/{domain/entities → shared/domain}/base.js +0 -0
- /package/{domain/entities → shared/domain}/context.d.ts +0 -0
- /package/{domain/entities → shared/domain}/context.js +0 -0
- /package/{domain/entities → shared/domain}/observer.js +0 -0
- /package/{domain/entities → shared/domain}/signals.d.ts +0 -0
- /package/{domain/entities → shared/domain}/signals.js +0 -0
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.CoreLibrary = void 0;
|
|
13
|
+
const __1 = require("../../");
|
|
14
|
+
const domain_1 = require("../../shared/domain");
|
|
15
|
+
const domain_2 = require("../../operand/domain");
|
|
16
|
+
const application_1 = require("../../operand/application");
|
|
4
17
|
const h3lp_1 = require("h3lp");
|
|
5
|
-
const domain_1 = require("../../domain");
|
|
6
|
-
const helper_1 = require("../helper");
|
|
7
18
|
class CoreLibrary {
|
|
8
|
-
// eslint-disable-next-line no-useless-constructor
|
|
9
|
-
constructor(model, builder) {
|
|
10
|
-
this.model = model;
|
|
11
|
-
this.builder = builder;
|
|
12
|
-
}
|
|
13
19
|
load() {
|
|
14
20
|
this.constants();
|
|
15
21
|
this.enums();
|
|
@@ -71,7 +77,9 @@ class CoreLibrary {
|
|
|
71
77
|
this.model.addOperator('&&(a:boolean,b:boolean):boolean', new And(), { priority: 3 });
|
|
72
78
|
this.model.addOperator('||(a:boolean,b:boolean):boolean', new Or(), { priority: 3 });
|
|
73
79
|
this.model.addOperator('!(a:boolean):boolean', (a) => !a, { priority: 5 });
|
|
74
|
-
|
|
80
|
+
// index is any, because it can also be string when used to access a property of an object
|
|
81
|
+
// example: orders[0]["number"]
|
|
82
|
+
this.model.addOperator('[](list:T[],index:any):T', (list, index) => list[index], { priority: 2 });
|
|
75
83
|
this.model.addOperator('$(name:string):string', (name) => process.env[name], { priority: 9 });
|
|
76
84
|
this.model.addOperator('=(a:T,b:T):T', new Assignment(), { priority: 1 });
|
|
77
85
|
this.model.addOperator('+=(a:number,b:number):number', new AssignmentAddition(), { priority: 1 });
|
|
@@ -94,11 +102,11 @@ class CoreLibrary {
|
|
|
94
102
|
});
|
|
95
103
|
}
|
|
96
104
|
nullFunctions() {
|
|
97
|
-
this.model.addFunction('nvl(value:T, default:T):T', (value, _default) =>
|
|
98
|
-
this.model.addFunction('nvl2(value:any, a:T,b:T):T', (value, a, b) =>
|
|
105
|
+
this.model.addFunction('nvl(value:T, default:T):T', (value, _default) => __1.helper.utils.nvl(value, _default));
|
|
106
|
+
this.model.addFunction('nvl2(value:any, a:T,b:T):T', (value, a, b) => __1.helper.utils.nvl2(value, a, b));
|
|
99
107
|
}
|
|
100
108
|
comparisonFunctions() {
|
|
101
|
-
this.model.addFunction('between(value:T,from:T,to:T):boolean', (value, from, to) =>
|
|
109
|
+
this.model.addFunction('between(value:T,from:T,to:T):boolean', (value, from, to) => __1.helper.val.between(value, from, to));
|
|
102
110
|
this.model.addFunction('includes(source:string|T[],value:string|T):boolean', (source, value) => source && value ? source.includes(value) : false);
|
|
103
111
|
this.model.addFunctionAlias('contains', 'includes');
|
|
104
112
|
this.model.addFunction('in(source:T,...values:T):boolean', (source, ...values) => {
|
|
@@ -112,27 +120,27 @@ class CoreLibrary {
|
|
|
112
120
|
return values.includes(source);
|
|
113
121
|
}
|
|
114
122
|
});
|
|
115
|
-
this.model.addFunction('isNull(value:any):boolean', (value) =>
|
|
116
|
-
this.model.addFunction('isNotNull(value:any):boolean', (value) =>
|
|
117
|
-
this.model.addFunction('isEmpty(value:string):boolean', (value) =>
|
|
118
|
-
this.model.addFunction('isNotEmpty(value:string):boolean', (value) =>
|
|
119
|
-
this.model.addFunction('isBoolean(value:any):boolean', (value) =>
|
|
120
|
-
this.model.addFunction('isNumber(value:any):boolean', (value) =>
|
|
121
|
-
this.model.addFunction('isInteger(value:any):boolean', (value) =>
|
|
122
|
-
this.model.addFunction('isDecimal(value:any):boolean', (value) =>
|
|
123
|
-
this.model.addFunction('isString(value:any):boolean', (value) =>
|
|
124
|
-
this.model.addFunction('isDate(value:any):boolean', (value) =>
|
|
125
|
-
this.model.addFunction('isDateTime(value:any):boolean', (value) =>
|
|
126
|
-
this.model.addFunction('isTime(value:any):boolean', (value) =>
|
|
127
|
-
this.model.addFunction('isObject(value:any):boolean', (value) =>
|
|
128
|
-
this.model.addFunction('isArray(value:any):boolean', (value) =>
|
|
129
|
-
this.model.addFunction('isBooleanFormat(value:string):boolean', (value) =>
|
|
130
|
-
this.model.addFunction('isNumberFormat(value:string):boolean', (value) =>
|
|
131
|
-
this.model.addFunction('isIntegerFormat(value:string):boolean', (value) =>
|
|
132
|
-
this.model.addFunction('isDecimalFormat(value:string):boolean', (value) =>
|
|
133
|
-
this.model.addFunction('isDateFormat(value:string):boolean', (value) =>
|
|
134
|
-
this.model.addFunction('isDateTimeFormat(value:string):boolean', (value) =>
|
|
135
|
-
this.model.addFunction('isTimeFormat(value:string):boolean', (value) =>
|
|
123
|
+
this.model.addFunction('isNull(value:any):boolean', (value) => __1.helper.val.isNull(value));
|
|
124
|
+
this.model.addFunction('isNotNull(value:any):boolean', (value) => __1.helper.val.isNotNull(value));
|
|
125
|
+
this.model.addFunction('isEmpty(value:string):boolean', (value) => __1.helper.val.isEmpty(value));
|
|
126
|
+
this.model.addFunction('isNotEmpty(value:string):boolean', (value) => __1.helper.val.isNotEmpty(value));
|
|
127
|
+
this.model.addFunction('isBoolean(value:any):boolean', (value) => __1.helper.val.isBoolean(value));
|
|
128
|
+
this.model.addFunction('isNumber(value:any):boolean', (value) => __1.helper.val.isNumber(value));
|
|
129
|
+
this.model.addFunction('isInteger(value:any):boolean', (value) => __1.helper.val.isInteger(value));
|
|
130
|
+
this.model.addFunction('isDecimal(value:any):boolean', (value) => __1.helper.val.isDecimal(value));
|
|
131
|
+
this.model.addFunction('isString(value:any):boolean', (value) => __1.helper.val.isString(value));
|
|
132
|
+
this.model.addFunction('isDate(value:any):boolean', (value) => __1.helper.val.isDate(value));
|
|
133
|
+
this.model.addFunction('isDateTime(value:any):boolean', (value) => __1.helper.val.isDateTime(value));
|
|
134
|
+
this.model.addFunction('isTime(value:any):boolean', (value) => __1.helper.val.isTime(value));
|
|
135
|
+
this.model.addFunction('isObject(value:any):boolean', (value) => __1.helper.val.isObject(value));
|
|
136
|
+
this.model.addFunction('isArray(value:any):boolean', (value) => __1.helper.val.isArray(value));
|
|
137
|
+
this.model.addFunction('isBooleanFormat(value:string):boolean', (value) => __1.helper.val.isBooleanFormat(value));
|
|
138
|
+
this.model.addFunction('isNumberFormat(value:string):boolean', (value) => __1.helper.val.isNumberFormat(value));
|
|
139
|
+
this.model.addFunction('isIntegerFormat(value:string):boolean', (value) => __1.helper.val.isIntegerFormat(value));
|
|
140
|
+
this.model.addFunction('isDecimalFormat(value:string):boolean', (value) => __1.helper.val.isDecimalFormat(value));
|
|
141
|
+
this.model.addFunction('isDateFormat(value:string):boolean', (value) => __1.helper.val.isDateFormat(value));
|
|
142
|
+
this.model.addFunction('isDateTimeFormat(value:string):boolean', (value) => __1.helper.val.isDateTimeFormat(value));
|
|
143
|
+
this.model.addFunction('isTimeFormat(value:string):boolean', (value) => __1.helper.val.isTimeFormat(value));
|
|
136
144
|
}
|
|
137
145
|
numberFunctions() {
|
|
138
146
|
this.model.addFunction('abs(x:number):number', Math.abs);
|
|
@@ -158,8 +166,8 @@ class CoreLibrary {
|
|
|
158
166
|
this.model.addFunction('trunc(x:number):number', Math.trunc);
|
|
159
167
|
}
|
|
160
168
|
conversionFunctions() {
|
|
161
|
-
this.model.addFunction('toString(value:any):string', (value) =>
|
|
162
|
-
this.model.addFunction('toNumber(value:any):number', (value) =>
|
|
169
|
+
this.model.addFunction('toString(value:any):string', (value) => __1.helper.str.toString(value));
|
|
170
|
+
this.model.addFunction('toNumber(value:any):number', (value) => __1.helper.utils.toNumber(value));
|
|
163
171
|
this.model.addFunction('dateToString(date:date):string', (date) => {
|
|
164
172
|
if (typeof date === 'string') {
|
|
165
173
|
return new Date(date).toISOString();
|
|
@@ -171,11 +179,11 @@ class CoreLibrary {
|
|
|
171
179
|
this.model.addFunction('keys(obj: any):string[]', (obj) => typeof obj === 'object' ? Object.keys(obj) : []);
|
|
172
180
|
this.model.addFunction('values(obj: any):any[]', (obj) => typeof obj === 'object' ? Object.values(obj) : []);
|
|
173
181
|
this.model.addFunction('entries(obj: any):[string,any][]', (obj) => typeof obj === 'object' ? Object.entries(obj) : []);
|
|
174
|
-
this.model.addFunction('fromEntries(entries: [string,any][]): any', (entries) =>
|
|
182
|
+
this.model.addFunction('fromEntries(entries: [string,any][]): any', (entries) => __1.helper.obj.fromEntries(entries));
|
|
175
183
|
}
|
|
176
184
|
stringFunctions() {
|
|
177
185
|
this.model.addFunction('chr(ascii: number):string', (ascii) => String.fromCharCode(ascii));
|
|
178
|
-
this.model.addFunction('capitalize(value:string):string', (value) =>
|
|
186
|
+
this.model.addFunction('capitalize(value:string):string', (value) => __1.helper.str.capitalize(value));
|
|
179
187
|
this.model.addFunction('endsWith(value:string, sub:string, start:number):boolean', (value, sub, start) => value.endsWith(sub, start));
|
|
180
188
|
this.model.addFunction('strCount(source: string, value: string):number', (source, value) => source.split(value).length - 1);
|
|
181
189
|
this.model.addFunction('lower(value: string):string', (value) => value.toLowerCase());
|
|
@@ -183,17 +191,17 @@ class CoreLibrary {
|
|
|
183
191
|
this.model.addFunction('ltrim(value: string):string', (value) => value.trimLeft());
|
|
184
192
|
this.model.addFunction('indexOf(value:string, sub:string, start:number):number', (value, sub, start) => value.indexOf(sub, start));
|
|
185
193
|
this.model.addFunction('join(values:string[],separator:string=","):string', (values, separator = ',') => values.join(separator));
|
|
186
|
-
this.model.addFunction('replace(value: string, source: string, target: string):string', (value, source, target) =>
|
|
194
|
+
this.model.addFunction('replace(value: string, source: string, target: string):string', (value, source, target) => __1.helper.str.replace(value, source, target));
|
|
187
195
|
this.model.addFunction('rpad(value: string, len: number, pad: string):string', (value, len, pad) => value.padEnd(len, pad));
|
|
188
196
|
this.model.addFunction('rtrim(value: string):string', (value) => value.trimRight());
|
|
189
197
|
this.model.addFunction('substring(value: string, from: number, count: number):string', (value, from, count) => value.substring(from, count));
|
|
190
198
|
this.model.addFunctionAlias('substr', 'substring');
|
|
191
199
|
this.model.addFunction('trim(value: string):string', (value) => value.trim());
|
|
192
200
|
this.model.addFunction('upper(value: string):string', (value) => value.toUpperCase());
|
|
193
|
-
this.model.addFunction('concat(...values:any):string', (...values) =>
|
|
201
|
+
this.model.addFunction('concat(...values:any):string', (...values) => __1.helper.str.concat(values));
|
|
194
202
|
this.model.addFunctionAlias('concatenate', 'concat');
|
|
195
203
|
this.model.addFunction('test(value: string, regexp: string):boolean', (value, regexp) => new RegExp(regexp).test(value));
|
|
196
|
-
this.model.addFunction('title(value:string):string', (value) =>
|
|
204
|
+
this.model.addFunction('title(value:string):string', (value) => __1.helper.str.initCap(value));
|
|
197
205
|
this.model.addFunction('match(value: string, regexp: string):any', (value, regexp) => value ? value.match(regexp) : null);
|
|
198
206
|
this.model.addFunction('mask(value: string):string', (value) => {
|
|
199
207
|
if (!value)
|
|
@@ -402,8 +410,16 @@ class CoreLibrary {
|
|
|
402
410
|
this.model.addFunction('symmetricDifference(a: T[], b: T[]): T[]', new SymmetricDifference());
|
|
403
411
|
}
|
|
404
412
|
}
|
|
413
|
+
__decorate([
|
|
414
|
+
(0, h3lp_1.Autowired)('exp.operand.builder.sync'),
|
|
415
|
+
__metadata("design:type", Object)
|
|
416
|
+
], CoreLibrary.prototype, "builder", void 0);
|
|
417
|
+
__decorate([
|
|
418
|
+
(0, h3lp_1.Autowired)('exp.model.service'),
|
|
419
|
+
__metadata("design:type", Object)
|
|
420
|
+
], CoreLibrary.prototype, "model", void 0);
|
|
405
421
|
exports.CoreLibrary = CoreLibrary;
|
|
406
|
-
class And extends
|
|
422
|
+
class And extends domain_2.PrototypeEvaluator {
|
|
407
423
|
clone(operand) {
|
|
408
424
|
return new And(operand);
|
|
409
425
|
}
|
|
@@ -416,7 +432,7 @@ class And extends domain_1.PrototypeEvaluator {
|
|
|
416
432
|
return this.operand.children[1].eval(context);
|
|
417
433
|
}
|
|
418
434
|
}
|
|
419
|
-
class Or extends
|
|
435
|
+
class Or extends domain_2.PrototypeEvaluator {
|
|
420
436
|
clone(operand) {
|
|
421
437
|
return new Or(operand);
|
|
422
438
|
}
|
|
@@ -429,7 +445,7 @@ class Or extends domain_1.PrototypeEvaluator {
|
|
|
429
445
|
return this.operand.children[1].eval(context);
|
|
430
446
|
}
|
|
431
447
|
}
|
|
432
|
-
class Assignment extends
|
|
448
|
+
class Assignment extends domain_2.PrototypeEvaluator {
|
|
433
449
|
clone(operand) {
|
|
434
450
|
return new Assignment(operand);
|
|
435
451
|
}
|
|
@@ -442,7 +458,7 @@ class Assignment extends domain_1.PrototypeEvaluator {
|
|
|
442
458
|
return value;
|
|
443
459
|
}
|
|
444
460
|
}
|
|
445
|
-
class AssignmentAddition extends
|
|
461
|
+
class AssignmentAddition extends domain_2.PrototypeEvaluator {
|
|
446
462
|
clone(operand) {
|
|
447
463
|
return new AssignmentAddition(operand);
|
|
448
464
|
}
|
|
@@ -455,7 +471,7 @@ class AssignmentAddition extends domain_1.PrototypeEvaluator {
|
|
|
455
471
|
return value;
|
|
456
472
|
}
|
|
457
473
|
}
|
|
458
|
-
class AssignmentSubtraction extends
|
|
474
|
+
class AssignmentSubtraction extends domain_2.PrototypeEvaluator {
|
|
459
475
|
clone(operand) {
|
|
460
476
|
return new AssignmentSubtraction(operand);
|
|
461
477
|
}
|
|
@@ -468,7 +484,7 @@ class AssignmentSubtraction extends domain_1.PrototypeEvaluator {
|
|
|
468
484
|
return value;
|
|
469
485
|
}
|
|
470
486
|
}
|
|
471
|
-
class AssignmentMultiplication extends
|
|
487
|
+
class AssignmentMultiplication extends domain_2.PrototypeEvaluator {
|
|
472
488
|
clone(operand) {
|
|
473
489
|
return new AssignmentMultiplication(operand);
|
|
474
490
|
}
|
|
@@ -481,7 +497,7 @@ class AssignmentMultiplication extends domain_1.PrototypeEvaluator {
|
|
|
481
497
|
return value;
|
|
482
498
|
}
|
|
483
499
|
}
|
|
484
|
-
class AssignmentDivision extends
|
|
500
|
+
class AssignmentDivision extends domain_2.PrototypeEvaluator {
|
|
485
501
|
clone(operand) {
|
|
486
502
|
return new AssignmentDivision(operand);
|
|
487
503
|
}
|
|
@@ -494,7 +510,7 @@ class AssignmentDivision extends domain_1.PrototypeEvaluator {
|
|
|
494
510
|
return value;
|
|
495
511
|
}
|
|
496
512
|
}
|
|
497
|
-
class AssignmentExponentiation extends
|
|
513
|
+
class AssignmentExponentiation extends domain_2.PrototypeEvaluator {
|
|
498
514
|
clone(operand) {
|
|
499
515
|
return new AssignmentExponentiation(operand);
|
|
500
516
|
}
|
|
@@ -507,7 +523,7 @@ class AssignmentExponentiation extends domain_1.PrototypeEvaluator {
|
|
|
507
523
|
return value;
|
|
508
524
|
}
|
|
509
525
|
}
|
|
510
|
-
class AssignmentFloorDivision extends
|
|
526
|
+
class AssignmentFloorDivision extends domain_2.PrototypeEvaluator {
|
|
511
527
|
clone(operand) {
|
|
512
528
|
return new AssignmentFloorDivision(operand);
|
|
513
529
|
}
|
|
@@ -520,7 +536,7 @@ class AssignmentFloorDivision extends domain_1.PrototypeEvaluator {
|
|
|
520
536
|
return value;
|
|
521
537
|
}
|
|
522
538
|
}
|
|
523
|
-
class AssignmentMod extends
|
|
539
|
+
class AssignmentMod extends domain_2.PrototypeEvaluator {
|
|
524
540
|
clone(operand) {
|
|
525
541
|
return new AssignmentMod(operand);
|
|
526
542
|
}
|
|
@@ -533,7 +549,7 @@ class AssignmentMod extends domain_1.PrototypeEvaluator {
|
|
|
533
549
|
return value;
|
|
534
550
|
}
|
|
535
551
|
}
|
|
536
|
-
class AssignmentBitAnd extends
|
|
552
|
+
class AssignmentBitAnd extends domain_2.PrototypeEvaluator {
|
|
537
553
|
clone(operand) {
|
|
538
554
|
return new AssignmentBitAnd(operand);
|
|
539
555
|
}
|
|
@@ -546,7 +562,7 @@ class AssignmentBitAnd extends domain_1.PrototypeEvaluator {
|
|
|
546
562
|
return value;
|
|
547
563
|
}
|
|
548
564
|
}
|
|
549
|
-
class AssignmentBitOr extends
|
|
565
|
+
class AssignmentBitOr extends domain_2.PrototypeEvaluator {
|
|
550
566
|
clone(operand) {
|
|
551
567
|
return new AssignmentBitOr(operand);
|
|
552
568
|
}
|
|
@@ -559,7 +575,7 @@ class AssignmentBitOr extends domain_1.PrototypeEvaluator {
|
|
|
559
575
|
return value;
|
|
560
576
|
}
|
|
561
577
|
}
|
|
562
|
-
class AssignmentBitXor extends
|
|
578
|
+
class AssignmentBitXor extends domain_2.PrototypeEvaluator {
|
|
563
579
|
clone(operand) {
|
|
564
580
|
return new AssignmentBitXor(operand);
|
|
565
581
|
}
|
|
@@ -572,7 +588,7 @@ class AssignmentBitXor extends domain_1.PrototypeEvaluator {
|
|
|
572
588
|
return value;
|
|
573
589
|
}
|
|
574
590
|
}
|
|
575
|
-
class AssignmentLeftShift extends
|
|
591
|
+
class AssignmentLeftShift extends domain_2.PrototypeEvaluator {
|
|
576
592
|
clone(operand) {
|
|
577
593
|
return new AssignmentLeftShift(operand);
|
|
578
594
|
}
|
|
@@ -585,7 +601,7 @@ class AssignmentLeftShift extends domain_1.PrototypeEvaluator {
|
|
|
585
601
|
return value;
|
|
586
602
|
}
|
|
587
603
|
}
|
|
588
|
-
class AssignmentRightShift extends
|
|
604
|
+
class AssignmentRightShift extends domain_2.PrototypeEvaluator {
|
|
589
605
|
clone(operand) {
|
|
590
606
|
return new AssignmentRightShift(operand);
|
|
591
607
|
}
|
|
@@ -598,11 +614,12 @@ class AssignmentRightShift extends domain_1.PrototypeEvaluator {
|
|
|
598
614
|
return value;
|
|
599
615
|
}
|
|
600
616
|
}
|
|
601
|
-
class Map extends
|
|
617
|
+
class Map extends domain_2.PrototypeEvaluator {
|
|
602
618
|
// eslint-disable-next-line no-useless-constructor
|
|
603
619
|
constructor(builder, operand) {
|
|
604
620
|
super(operand);
|
|
605
621
|
this.builder = builder;
|
|
622
|
+
this.operandClone = new application_1.OperandClone();
|
|
606
623
|
}
|
|
607
624
|
clone(operand) {
|
|
608
625
|
return new Map(this.builder, operand);
|
|
@@ -623,7 +640,7 @@ class Map extends domain_1.PrototypeEvaluator {
|
|
|
623
640
|
// In the case of being an object the value to return, find out if there are fields that are summarized
|
|
624
641
|
const keyValue = child;
|
|
625
642
|
if (keyValue) {
|
|
626
|
-
if (
|
|
643
|
+
if (__1.helper.operand.haveAggregates(keyValue.children[0])) {
|
|
627
644
|
aggregates.push(keyValue);
|
|
628
645
|
}
|
|
629
646
|
else {
|
|
@@ -633,13 +650,13 @@ class Map extends domain_1.PrototypeEvaluator {
|
|
|
633
650
|
}
|
|
634
651
|
if (aggregates.length > 0) {
|
|
635
652
|
// case with aggregate functions
|
|
636
|
-
const keys =
|
|
653
|
+
const keys = __1.helper.operand.getKeys(this.operand.children[1], groupers, list, context);
|
|
637
654
|
// once you got all the keys you have to calculate the aggregates fields
|
|
638
655
|
const variable = this.operand.children[1];
|
|
639
656
|
for (const key of keys) {
|
|
640
657
|
for (const keyValue of aggregates) {
|
|
641
|
-
const operandCloned = this.
|
|
642
|
-
const operandResolved =
|
|
658
|
+
const operandCloned = this.operandClone.clone(keyValue.children[0], 'sync');
|
|
659
|
+
const operandResolved = __1.helper.operand.solveAggregates(key.items, variable, operandCloned, context);
|
|
643
660
|
const value = operandResolved.eval(context);
|
|
644
661
|
key.summarizers.push({ name: keyValue.name, value });
|
|
645
662
|
}
|
|
@@ -672,7 +689,7 @@ class Map extends domain_1.PrototypeEvaluator {
|
|
|
672
689
|
return rows;
|
|
673
690
|
}
|
|
674
691
|
}
|
|
675
|
-
class Distinct extends
|
|
692
|
+
class Distinct extends domain_2.PrototypeEvaluator {
|
|
676
693
|
clone(operand) {
|
|
677
694
|
return new Distinct(operand);
|
|
678
695
|
}
|
|
@@ -696,7 +713,7 @@ class Distinct extends domain_1.PrototypeEvaluator {
|
|
|
696
713
|
}
|
|
697
714
|
else if (this.operand.children[2].type === domain_1.OperandType.Obj) {
|
|
698
715
|
// case with aggregate functions
|
|
699
|
-
const keys =
|
|
716
|
+
const keys = __1.helper.operand.getKeys(this.operand.children[1], this.operand.children[2].children, list, context.newContext());
|
|
700
717
|
// build the list of results
|
|
701
718
|
for (const key of keys) {
|
|
702
719
|
const row = {};
|
|
@@ -722,7 +739,7 @@ class Distinct extends domain_1.PrototypeEvaluator {
|
|
|
722
739
|
return rows;
|
|
723
740
|
}
|
|
724
741
|
}
|
|
725
|
-
class Foreach extends
|
|
742
|
+
class Foreach extends domain_2.PrototypeEvaluator {
|
|
726
743
|
clone(operand) {
|
|
727
744
|
return new Foreach(operand);
|
|
728
745
|
}
|
|
@@ -742,7 +759,7 @@ class Foreach extends domain_1.PrototypeEvaluator {
|
|
|
742
759
|
return list;
|
|
743
760
|
}
|
|
744
761
|
}
|
|
745
|
-
class Filter extends
|
|
762
|
+
class Filter extends domain_2.PrototypeEvaluator {
|
|
746
763
|
clone(operand) {
|
|
747
764
|
return new Filter(operand);
|
|
748
765
|
}
|
|
@@ -765,7 +782,7 @@ class Filter extends domain_1.PrototypeEvaluator {
|
|
|
765
782
|
return rows;
|
|
766
783
|
}
|
|
767
784
|
}
|
|
768
|
-
class Reverse extends
|
|
785
|
+
class Reverse extends domain_2.PrototypeEvaluator {
|
|
769
786
|
clone(operand) {
|
|
770
787
|
return new Reverse(operand);
|
|
771
788
|
}
|
|
@@ -792,7 +809,7 @@ class Reverse extends domain_1.PrototypeEvaluator {
|
|
|
792
809
|
return values.map(p => p.p);
|
|
793
810
|
}
|
|
794
811
|
}
|
|
795
|
-
class Sort extends
|
|
812
|
+
class Sort extends domain_2.PrototypeEvaluator {
|
|
796
813
|
clone(operand) {
|
|
797
814
|
return new Sort(operand);
|
|
798
815
|
}
|
|
@@ -818,7 +835,7 @@ class Sort extends domain_1.PrototypeEvaluator {
|
|
|
818
835
|
return values.map(p => p.p);
|
|
819
836
|
}
|
|
820
837
|
}
|
|
821
|
-
class Remove extends
|
|
838
|
+
class Remove extends domain_2.PrototypeEvaluator {
|
|
822
839
|
clone(operand) {
|
|
823
840
|
return new Remove(operand);
|
|
824
841
|
}
|
|
@@ -841,7 +858,7 @@ class Remove extends domain_1.PrototypeEvaluator {
|
|
|
841
858
|
return rows;
|
|
842
859
|
}
|
|
843
860
|
}
|
|
844
|
-
class First extends
|
|
861
|
+
class First extends domain_2.PrototypeEvaluator {
|
|
845
862
|
clone(operand) {
|
|
846
863
|
return new First(operand);
|
|
847
864
|
}
|
|
@@ -856,10 +873,10 @@ class First extends domain_1.PrototypeEvaluator {
|
|
|
856
873
|
if (this.operand.children.length === 1) {
|
|
857
874
|
return list && list.length > 0 ? list[0] : null;
|
|
858
875
|
}
|
|
859
|
-
return
|
|
876
|
+
return __1.helper.operand.first(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
860
877
|
}
|
|
861
878
|
}
|
|
862
|
-
class Last extends
|
|
879
|
+
class Last extends domain_2.PrototypeEvaluator {
|
|
863
880
|
clone(operand) {
|
|
864
881
|
return new Last(operand);
|
|
865
882
|
}
|
|
@@ -874,10 +891,10 @@ class Last extends domain_1.PrototypeEvaluator {
|
|
|
874
891
|
if (this.operand.children.length === 1) {
|
|
875
892
|
return list && list.length > 0 ? list[list.length - 1] : null;
|
|
876
893
|
}
|
|
877
|
-
return
|
|
894
|
+
return __1.helper.operand.last(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
878
895
|
}
|
|
879
896
|
}
|
|
880
|
-
class Count extends
|
|
897
|
+
class Count extends domain_2.PrototypeEvaluator {
|
|
881
898
|
clone(operand) {
|
|
882
899
|
return new Count(operand);
|
|
883
900
|
}
|
|
@@ -892,10 +909,10 @@ class Count extends domain_1.PrototypeEvaluator {
|
|
|
892
909
|
if (this.operand.children.length === 1) {
|
|
893
910
|
return list.length;
|
|
894
911
|
}
|
|
895
|
-
return
|
|
912
|
+
return __1.helper.operand.count(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
896
913
|
}
|
|
897
914
|
}
|
|
898
|
-
class Max extends
|
|
915
|
+
class Max extends domain_2.PrototypeEvaluator {
|
|
899
916
|
clone(operand) {
|
|
900
917
|
return new Max(operand);
|
|
901
918
|
}
|
|
@@ -916,10 +933,10 @@ class Max extends domain_1.PrototypeEvaluator {
|
|
|
916
933
|
}
|
|
917
934
|
return max;
|
|
918
935
|
}
|
|
919
|
-
return
|
|
936
|
+
return __1.helper.operand.max(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
920
937
|
}
|
|
921
938
|
}
|
|
922
|
-
class Min extends
|
|
939
|
+
class Min extends domain_2.PrototypeEvaluator {
|
|
923
940
|
clone(operand) {
|
|
924
941
|
return new Min(operand);
|
|
925
942
|
}
|
|
@@ -940,10 +957,10 @@ class Min extends domain_1.PrototypeEvaluator {
|
|
|
940
957
|
}
|
|
941
958
|
return min;
|
|
942
959
|
}
|
|
943
|
-
return
|
|
960
|
+
return __1.helper.operand.min(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
944
961
|
}
|
|
945
962
|
}
|
|
946
|
-
class Avg extends
|
|
963
|
+
class Avg extends domain_2.PrototypeEvaluator {
|
|
947
964
|
clone(operand) {
|
|
948
965
|
return new Avg(operand);
|
|
949
966
|
}
|
|
@@ -964,10 +981,10 @@ class Avg extends domain_1.PrototypeEvaluator {
|
|
|
964
981
|
}
|
|
965
982
|
return list.length > 0 ? sum / list.length : 0;
|
|
966
983
|
}
|
|
967
|
-
return
|
|
984
|
+
return __1.helper.operand.avg(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
968
985
|
}
|
|
969
986
|
}
|
|
970
|
-
class Sum extends
|
|
987
|
+
class Sum extends domain_2.PrototypeEvaluator {
|
|
971
988
|
clone(operand) {
|
|
972
989
|
return new Sum(operand);
|
|
973
990
|
}
|
|
@@ -988,10 +1005,10 @@ class Sum extends domain_1.PrototypeEvaluator {
|
|
|
988
1005
|
}
|
|
989
1006
|
return sum;
|
|
990
1007
|
}
|
|
991
|
-
return
|
|
1008
|
+
return __1.helper.operand.sum(list, this.operand.children[1], this.operand.children[2], context.newContext());
|
|
992
1009
|
}
|
|
993
1010
|
}
|
|
994
|
-
class Union extends
|
|
1011
|
+
class Union extends domain_2.PrototypeEvaluator {
|
|
995
1012
|
clone(operand) {
|
|
996
1013
|
return new Union(operand);
|
|
997
1014
|
}
|
|
@@ -1019,11 +1036,11 @@ class Union extends domain_1.PrototypeEvaluator {
|
|
|
1019
1036
|
}
|
|
1020
1037
|
else if (typeof a[0] === 'object') {
|
|
1021
1038
|
for (const element of a) {
|
|
1022
|
-
const key =
|
|
1039
|
+
const key = __1.helper.operand.objectKey(element);
|
|
1023
1040
|
result.push({ key, value: element });
|
|
1024
1041
|
}
|
|
1025
1042
|
for (const element of b) {
|
|
1026
|
-
const key =
|
|
1043
|
+
const key = __1.helper.operand.objectKey(element);
|
|
1027
1044
|
if (!result.find((p) => p.key === key)) {
|
|
1028
1045
|
result.push({ key, value: element });
|
|
1029
1046
|
}
|
|
@@ -1039,7 +1056,7 @@ class Union extends domain_1.PrototypeEvaluator {
|
|
|
1039
1056
|
return result;
|
|
1040
1057
|
}
|
|
1041
1058
|
}
|
|
1042
|
-
class Intersection extends
|
|
1059
|
+
class Intersection extends domain_2.PrototypeEvaluator {
|
|
1043
1060
|
clone(operand) {
|
|
1044
1061
|
return new Intersection(operand);
|
|
1045
1062
|
}
|
|
@@ -1063,9 +1080,9 @@ class Intersection extends domain_1.PrototypeEvaluator {
|
|
|
1063
1080
|
throw new Error('Cannot union arrays of arrays');
|
|
1064
1081
|
}
|
|
1065
1082
|
else if (typeof a[0] === 'object') {
|
|
1066
|
-
const keys = a.map((p) =>
|
|
1083
|
+
const keys = a.map((p) => __1.helper.operand.objectKey(p));
|
|
1067
1084
|
for (const element of b) {
|
|
1068
|
-
const key =
|
|
1085
|
+
const key = __1.helper.operand.objectKey(element);
|
|
1069
1086
|
if (keys.includes(key)) {
|
|
1070
1087
|
result.push(element);
|
|
1071
1088
|
}
|
|
@@ -1082,7 +1099,7 @@ class Intersection extends domain_1.PrototypeEvaluator {
|
|
|
1082
1099
|
}
|
|
1083
1100
|
}
|
|
1084
1101
|
}
|
|
1085
|
-
class Difference extends
|
|
1102
|
+
class Difference extends domain_2.PrototypeEvaluator {
|
|
1086
1103
|
clone(operand) {
|
|
1087
1104
|
return new Difference(operand);
|
|
1088
1105
|
}
|
|
@@ -1109,9 +1126,9 @@ class Difference extends domain_1.PrototypeEvaluator {
|
|
|
1109
1126
|
throw new Error('Cannot union arrays of arrays');
|
|
1110
1127
|
}
|
|
1111
1128
|
else if (typeof a[0] === 'object') {
|
|
1112
|
-
const keys = b.map((p) =>
|
|
1129
|
+
const keys = b.map((p) => __1.helper.operand.objectKey(p));
|
|
1113
1130
|
for (const element of a) {
|
|
1114
|
-
const key =
|
|
1131
|
+
const key = __1.helper.operand.objectKey(element);
|
|
1115
1132
|
if (!keys.includes(key)) {
|
|
1116
1133
|
result.push(element);
|
|
1117
1134
|
}
|
|
@@ -1128,7 +1145,7 @@ class Difference extends domain_1.PrototypeEvaluator {
|
|
|
1128
1145
|
}
|
|
1129
1146
|
}
|
|
1130
1147
|
}
|
|
1131
|
-
class SymmetricDifference extends
|
|
1148
|
+
class SymmetricDifference extends domain_2.PrototypeEvaluator {
|
|
1132
1149
|
clone(operand) {
|
|
1133
1150
|
return new SymmetricDifference(operand);
|
|
1134
1151
|
}
|
|
@@ -1155,16 +1172,16 @@ class SymmetricDifference extends domain_1.PrototypeEvaluator {
|
|
|
1155
1172
|
throw new Error('Cannot union arrays of arrays');
|
|
1156
1173
|
}
|
|
1157
1174
|
else if (typeof a[0] === 'object') {
|
|
1158
|
-
const aKeys = a.map((p) =>
|
|
1159
|
-
const bKeys = b.map((p) =>
|
|
1175
|
+
const aKeys = a.map((p) => __1.helper.operand.objectKey(p));
|
|
1176
|
+
const bKeys = b.map((p) => __1.helper.operand.objectKey(p));
|
|
1160
1177
|
for (const element of a) {
|
|
1161
|
-
const key =
|
|
1178
|
+
const key = __1.helper.operand.objectKey(element);
|
|
1162
1179
|
if (!bKeys.includes(key)) {
|
|
1163
1180
|
result.push(element);
|
|
1164
1181
|
}
|
|
1165
1182
|
}
|
|
1166
1183
|
for (const element of b) {
|
|
1167
|
-
const key =
|
|
1184
|
+
const key = __1.helper.operand.objectKey(element);
|
|
1168
1185
|
if (!aKeys.includes(key)) {
|
|
1169
1186
|
result.push(element);
|
|
1170
1187
|
}
|