quicktype 17.0.5 → 18.0.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/dist/cli/CompressedJSONFromStream.js +26 -38
- package/dist/cli/GraphQLIntrospection.js +33 -41
- package/dist/cli/TypeSource.d.ts +1 -1
- package/dist/cli/URLGrammar.js +4 -3
- package/dist/cli/index.js +363 -364
- package/dist/quicktype-core/Annotation.js +2 -0
- package/dist/quicktype-core/ConvenienceRenderer.d.ts +17 -17
- package/dist/quicktype-core/ConvenienceRenderer.js +104 -81
- package/dist/quicktype-core/DateTime.js +1 -0
- package/dist/quicktype-core/DeclarationIR.d.ts +1 -1
- package/dist/quicktype-core/DeclarationIR.js +13 -10
- package/dist/quicktype-core/EncodedMarkovChain.js +1 -0
- package/dist/quicktype-core/GatherNames.js +47 -25
- package/dist/quicktype-core/Graph.d.ts +2 -2
- package/dist/quicktype-core/Graph.js +23 -19
- package/dist/quicktype-core/GraphRewriting.d.ts +2 -2
- package/dist/quicktype-core/GraphRewriting.js +65 -54
- package/dist/quicktype-core/MakeTransformations.js +23 -22
- package/dist/quicktype-core/MarkovChain.d.ts +3 -3
- package/dist/quicktype-core/MarkovChain.js +9 -8
- package/dist/quicktype-core/Messages.d.ts +3 -3
- package/dist/quicktype-core/Messages.js +8 -3
- package/dist/quicktype-core/Naming.d.ts +11 -11
- package/dist/quicktype-core/Naming.js +76 -61
- package/dist/quicktype-core/Renderer.d.ts +6 -6
- package/dist/quicktype-core/Renderer.js +34 -17
- package/dist/quicktype-core/RendererOptions.d.ts +5 -5
- package/dist/quicktype-core/RendererOptions.js +6 -3
- package/dist/quicktype-core/Run.d.ts +9 -9
- package/dist/quicktype-core/Run.js +72 -67
- package/dist/quicktype-core/Source.d.ts +3 -3
- package/dist/quicktype-core/Source.js +19 -18
- package/dist/quicktype-core/TargetLanguage.d.ts +10 -10
- package/dist/quicktype-core/TargetLanguage.js +6 -2
- package/dist/quicktype-core/Transformers.d.ts +25 -25
- package/dist/quicktype-core/Transformers.js +94 -66
- package/dist/quicktype-core/Type.d.ts +41 -43
- package/dist/quicktype-core/Type.js +96 -71
- package/dist/quicktype-core/TypeBuilder.d.ts +2 -2
- package/dist/quicktype-core/TypeBuilder.js +53 -47
- package/dist/quicktype-core/TypeGraph.d.ts +4 -4
- package/dist/quicktype-core/TypeGraph.js +49 -40
- package/dist/quicktype-core/TypeUtils.d.ts +2 -2
- package/dist/quicktype-core/TypeUtils.js +23 -22
- package/dist/quicktype-core/UnifyClasses.js +16 -12
- package/dist/quicktype-core/UnionBuilder.d.ts +3 -3
- package/dist/quicktype-core/UnionBuilder.js +33 -30
- package/dist/quicktype-core/attributes/AccessorNames.d.ts +2 -2
- package/dist/quicktype-core/attributes/AccessorNames.js +18 -17
- package/dist/quicktype-core/attributes/Constraints.d.ts +3 -3
- package/dist/quicktype-core/attributes/Constraints.js +8 -4
- package/dist/quicktype-core/attributes/Description.js +6 -5
- package/dist/quicktype-core/attributes/EnumValues.js +4 -3
- package/dist/quicktype-core/attributes/StringTypes.d.ts +1 -1
- package/dist/quicktype-core/attributes/StringTypes.js +24 -21
- package/dist/quicktype-core/attributes/TypeAttributes.d.ts +3 -3
- package/dist/quicktype-core/attributes/TypeAttributes.js +12 -10
- package/dist/quicktype-core/attributes/TypeNames.d.ts +9 -9
- package/dist/quicktype-core/attributes/TypeNames.js +49 -21
- package/dist/quicktype-core/attributes/URIAttributes.d.ts +1 -1
- package/dist/quicktype-core/attributes/URIAttributes.js +10 -6
- package/dist/quicktype-core/index.js +128 -125
- package/dist/quicktype-core/input/CompressedJSON.d.ts +7 -7
- package/dist/quicktype-core/input/CompressedJSON.js +49 -54
- package/dist/quicktype-core/input/FetchingJSONSchemaStore.js +5 -13
- package/dist/quicktype-core/input/Inference.d.ts +2 -2
- package/dist/quicktype-core/input/Inference.js +25 -17
- package/dist/quicktype-core/input/Inputs.d.ts +2 -2
- package/dist/quicktype-core/input/Inputs.js +38 -54
- package/dist/quicktype-core/input/JSONSchemaInput.d.ts +11 -11
- package/dist/quicktype-core/input/JSONSchemaInput.js +503 -523
- package/dist/quicktype-core/input/JSONSchemaStore.d.ts +1 -1
- package/dist/quicktype-core/input/JSONSchemaStore.js +24 -35
- package/dist/quicktype-core/input/PostmanCollection.js +2 -1
- package/dist/quicktype-core/input/io/NodeIO.js +55 -44
- package/dist/quicktype-core/input/io/get-stream/index.js +6 -2
- package/dist/quicktype-core/language/All.js +3 -2
- package/dist/quicktype-core/language/CPlusPlus.d.ts +12 -9
- package/dist/quicktype-core/language/CPlusPlus.js +283 -217
- package/dist/quicktype-core/language/CSharp.d.ts +7 -7
- package/dist/quicktype-core/language/CSharp.js +82 -72
- package/dist/quicktype-core/language/Crystal.d.ts +2 -2
- package/dist/quicktype-core/language/Crystal.js +18 -17
- package/dist/quicktype-core/language/Dart.d.ts +4 -4
- package/dist/quicktype-core/language/Dart.js +36 -34
- package/dist/quicktype-core/language/Elm.d.ts +6 -6
- package/dist/quicktype-core/language/Elm.js +47 -45
- package/dist/quicktype-core/language/Golang.d.ts +4 -4
- package/dist/quicktype-core/language/Golang.js +23 -20
- package/dist/quicktype-core/language/Haskell.d.ts +5 -5
- package/dist/quicktype-core/language/Haskell.js +25 -23
- package/dist/quicktype-core/language/JSONSchema.d.ts +3 -3
- package/dist/quicktype-core/language/JSONSchema.js +17 -16
- package/dist/quicktype-core/language/Java.d.ts +2 -2
- package/dist/quicktype-core/language/Java.js +97 -97
- package/dist/quicktype-core/language/JavaScript.d.ts +7 -7
- package/dist/quicktype-core/language/JavaScript.js +19 -17
- package/dist/quicktype-core/language/JavaScriptPropTypes.js +15 -13
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.js +12 -11
- package/dist/quicktype-core/language/Kotlin.d.ts +2 -2
- package/dist/quicktype-core/language/Kotlin.js +39 -37
- package/dist/quicktype-core/language/Objective-C.d.ts +3 -3
- package/dist/quicktype-core/language/Objective-C.js +45 -41
- package/dist/quicktype-core/language/Php.d.ts +2 -2
- package/dist/quicktype-core/language/Php.js +66 -41
- package/dist/quicktype-core/language/Pike.d.ts +1 -1
- package/dist/quicktype-core/language/Pike.js +18 -17
- package/dist/quicktype-core/language/Python.d.ts +8 -8
- package/dist/quicktype-core/language/Python.js +63 -64
- package/dist/quicktype-core/language/Rust.d.ts +2 -2
- package/dist/quicktype-core/language/Rust.js +21 -19
- package/dist/quicktype-core/language/Swift.d.ts +7 -7
- package/dist/quicktype-core/language/Swift.js +568 -565
- package/dist/quicktype-core/language/TypeScriptFlow.d.ts +7 -7
- package/dist/quicktype-core/language/TypeScriptFlow.js +28 -26
- package/dist/quicktype-core/language/ruby/index.d.ts +4 -4
- package/dist/quicktype-core/language/ruby/index.js +49 -24
- package/dist/quicktype-core/language/ruby/keywords.js +1 -0
- package/dist/quicktype-core/rewrites/CombineClasses.js +9 -8
- package/dist/quicktype-core/rewrites/ExpandStrings.d.ts +1 -1
- package/dist/quicktype-core/rewrites/ExpandStrings.js +18 -17
- package/dist/quicktype-core/rewrites/FlattenStrings.js +7 -6
- package/dist/quicktype-core/rewrites/FlattenUnions.js +9 -8
- package/dist/quicktype-core/rewrites/InferMaps.js +11 -10
- package/dist/quicktype-core/rewrites/ReplaceObjectType.js +8 -7
- package/dist/quicktype-core/rewrites/ResolveIntersections.js +68 -67
- package/dist/quicktype-core/support/Acronyms.js +3 -1
- package/dist/quicktype-core/support/Chance.js +10 -0
- package/dist/quicktype-core/support/Converters.js +1 -0
- package/dist/quicktype-core/support/Strings.d.ts +4 -4
- package/dist/quicktype-core/support/Strings.js +17 -16
- package/dist/quicktype-core/support/Support.d.ts +1 -1
- package/dist/quicktype-core/support/Support.js +30 -6
- package/dist/quicktype-graphql-input/GraphQLSchema.d.ts +4 -4
- package/dist/quicktype-graphql-input/GraphQLSchema.js +1 -0
- package/dist/quicktype-graphql-input/index.d.ts +1 -1
- package/dist/quicktype-graphql-input/index.js +229 -212
- package/dist/quicktype-typescript-input/index.js +28 -4
- package/package.json +24 -20
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.followTargetType = exports.transformationForType = exports.transformationTypeAttributeKind = exports.Transformation = exports.MinMaxValueTransformer = exports.MinMaxLengthCheckTransformer = exports.StringifyTransformer = exports.ParseStringTransformer = exports.StringProducerTransformer = exports.UnionInstantiationTransformer = exports.StringMatchTransformer = exports.UnionMemberMatchTransformer = exports.DecodingChoiceTransformer = exports.ChoiceTransformer = exports.ArrayEncodingTransformer = exports.ArrayDecodingTransformer = exports.EncodingTransformer = exports.DecodingTransformer = exports.MatchTransformer = exports.ProducerTransformer = exports.Transformer = void 0;
|
|
3
4
|
const collection_utils_1 = require("collection-utils");
|
|
4
5
|
const Type_1 = require("./Type");
|
|
5
6
|
const TypeAttributes_1 = require("./attributes/TypeAttributes");
|
|
@@ -13,16 +14,19 @@ function debugStringForType(t) {
|
|
|
13
14
|
return `${t.kind} (${target.kind})`;
|
|
14
15
|
}
|
|
15
16
|
function getNumberOfNodes(xfer) {
|
|
16
|
-
return collection_utils_1.definedMapWithDefault(xfer, 0, x => x.getNumberOfNodes());
|
|
17
|
+
return (0, collection_utils_1.definedMapWithDefault)(xfer, 0, x => x.getNumberOfNodes());
|
|
17
18
|
}
|
|
18
19
|
class Transformer {
|
|
20
|
+
kind;
|
|
21
|
+
graph;
|
|
22
|
+
sourceTypeRef;
|
|
19
23
|
constructor(kind, graph, sourceTypeRef) {
|
|
20
24
|
this.kind = kind;
|
|
21
25
|
this.graph = graph;
|
|
22
26
|
this.sourceTypeRef = sourceTypeRef;
|
|
23
27
|
}
|
|
24
28
|
get sourceType() {
|
|
25
|
-
return TypeGraph_1.derefTypeRef(this.sourceTypeRef, this.graph);
|
|
29
|
+
return (0, TypeGraph_1.derefTypeRef)(this.sourceTypeRef, this.graph);
|
|
26
30
|
}
|
|
27
31
|
/** This must return a newly constructed set. */
|
|
28
32
|
getChildren() {
|
|
@@ -37,7 +41,7 @@ class Transformer {
|
|
|
37
41
|
return this.sourceTypeRef === other.sourceTypeRef;
|
|
38
42
|
}
|
|
39
43
|
hashCode() {
|
|
40
|
-
return collection_utils_1.hashCodeOf(this.sourceTypeRef);
|
|
44
|
+
return (0, collection_utils_1.hashCodeOf)(this.sourceTypeRef);
|
|
41
45
|
}
|
|
42
46
|
debugDescription() {
|
|
43
47
|
return `${debugStringForType(this.sourceType)} -> ${this.kind}`;
|
|
@@ -46,12 +50,13 @@ class Transformer {
|
|
|
46
50
|
return;
|
|
47
51
|
}
|
|
48
52
|
debugPrint(indent) {
|
|
49
|
-
console.log(Support_1.indentationString(indent) + this.debugDescription());
|
|
53
|
+
console.log((0, Support_1.indentationString)(indent) + this.debugDescription());
|
|
50
54
|
this.debugPrintContinuations(indent + 1);
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
exports.Transformer = Transformer;
|
|
54
58
|
class ProducerTransformer extends Transformer {
|
|
59
|
+
consumer;
|
|
55
60
|
constructor(kind, graph, sourceTypeRef, consumer) {
|
|
56
61
|
super(kind, graph, sourceTypeRef);
|
|
57
62
|
this.consumer = consumer;
|
|
@@ -60,7 +65,7 @@ class ProducerTransformer extends Transformer {
|
|
|
60
65
|
const children = super.getChildren();
|
|
61
66
|
if (this.consumer === undefined)
|
|
62
67
|
return children;
|
|
63
|
-
return collection_utils_1.setUnionInto(children, this.consumer.getChildren());
|
|
68
|
+
return (0, collection_utils_1.setUnionInto)(children, this.consumer.getChildren());
|
|
64
69
|
}
|
|
65
70
|
getNumberOfNodes() {
|
|
66
71
|
return super.getNumberOfNodes() + getNumberOfNodes(this.consumer);
|
|
@@ -70,11 +75,11 @@ class ProducerTransformer extends Transformer {
|
|
|
70
75
|
return false;
|
|
71
76
|
if (!(other instanceof ProducerTransformer))
|
|
72
77
|
return false;
|
|
73
|
-
return collection_utils_1.areEqual(this.consumer, other.consumer);
|
|
78
|
+
return (0, collection_utils_1.areEqual)(this.consumer, other.consumer);
|
|
74
79
|
}
|
|
75
80
|
hashCode() {
|
|
76
81
|
const h = super.hashCode();
|
|
77
|
-
return collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.consumer));
|
|
82
|
+
return (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.consumer));
|
|
78
83
|
}
|
|
79
84
|
debugPrintContinuations(indent) {
|
|
80
85
|
if (this.consumer === undefined)
|
|
@@ -84,12 +89,13 @@ class ProducerTransformer extends Transformer {
|
|
|
84
89
|
}
|
|
85
90
|
exports.ProducerTransformer = ProducerTransformer;
|
|
86
91
|
class MatchTransformer extends Transformer {
|
|
92
|
+
transformer;
|
|
87
93
|
constructor(kind, graph, sourceTypeRef, transformer) {
|
|
88
94
|
super(kind, graph, sourceTypeRef);
|
|
89
95
|
this.transformer = transformer;
|
|
90
96
|
}
|
|
91
97
|
getChildren() {
|
|
92
|
-
return collection_utils_1.setUnionInto(super.getChildren(), this.transformer.getChildren());
|
|
98
|
+
return (0, collection_utils_1.setUnionInto)(super.getChildren(), this.transformer.getChildren());
|
|
93
99
|
}
|
|
94
100
|
getNumberOfNodes() {
|
|
95
101
|
return super.getNumberOfNodes() + this.transformer.getNumberOfNodes();
|
|
@@ -103,7 +109,7 @@ class MatchTransformer extends Transformer {
|
|
|
103
109
|
}
|
|
104
110
|
hashCode() {
|
|
105
111
|
const h = super.hashCode();
|
|
106
|
-
return collection_utils_1.addHashCode(h, this.transformer.hashCode());
|
|
112
|
+
return (0, collection_utils_1.addHashCode)(h, this.transformer.hashCode());
|
|
107
113
|
}
|
|
108
114
|
debugPrintContinuations(indent) {
|
|
109
115
|
this.transformer.debugPrint(indent);
|
|
@@ -119,7 +125,7 @@ class DecodingTransformer extends ProducerTransformer {
|
|
|
119
125
|
}
|
|
120
126
|
reverse(targetTypeRef, continuationTransformer) {
|
|
121
127
|
if (continuationTransformer !== undefined) {
|
|
122
|
-
return Support_1.panic("Reversing a decoding transformer cannot have a continuation");
|
|
128
|
+
return (0, Support_1.panic)("Reversing a decoding transformer cannot have a continuation");
|
|
123
129
|
}
|
|
124
130
|
if (this.consumer === undefined) {
|
|
125
131
|
return new EncodingTransformer(this.graph, targetTypeRef);
|
|
@@ -129,7 +135,7 @@ class DecodingTransformer extends ProducerTransformer {
|
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
reconstitute(builder) {
|
|
132
|
-
return new DecodingTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)));
|
|
138
|
+
return new DecodingTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)));
|
|
133
139
|
}
|
|
134
140
|
equals(other) {
|
|
135
141
|
if (!super.equals(other))
|
|
@@ -146,7 +152,7 @@ class EncodingTransformer extends Transformer {
|
|
|
146
152
|
return false;
|
|
147
153
|
}
|
|
148
154
|
reverse(_targetTypeRef, _continuationTransformer) {
|
|
149
|
-
return Support_1.panic("Can't reverse encoding transformer");
|
|
155
|
+
return (0, Support_1.panic)("Can't reverse encoding transformer");
|
|
150
156
|
}
|
|
151
157
|
reconstitute(builder) {
|
|
152
158
|
return new EncodingTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef));
|
|
@@ -161,6 +167,8 @@ class EncodingTransformer extends Transformer {
|
|
|
161
167
|
}
|
|
162
168
|
exports.EncodingTransformer = EncodingTransformer;
|
|
163
169
|
class ArrayDecodingTransformer extends ProducerTransformer {
|
|
170
|
+
_itemTargetTypeRef;
|
|
171
|
+
itemTransformer;
|
|
164
172
|
constructor(graph, sourceTypeRef, consumer, _itemTargetTypeRef, itemTransformer) {
|
|
165
173
|
super("decode-array", graph, sourceTypeRef, consumer);
|
|
166
174
|
this._itemTargetTypeRef = _itemTargetTypeRef;
|
|
@@ -169,7 +177,7 @@ class ArrayDecodingTransformer extends ProducerTransformer {
|
|
|
169
177
|
getChildren() {
|
|
170
178
|
const children = super.getChildren();
|
|
171
179
|
children.add(this.itemTargetType);
|
|
172
|
-
return collection_utils_1.setUnionInto(children, this.itemTransformer.getChildren());
|
|
180
|
+
return (0, collection_utils_1.setUnionInto)(children, this.itemTransformer.getChildren());
|
|
173
181
|
}
|
|
174
182
|
getNumberOfNodes() {
|
|
175
183
|
return super.getNumberOfNodes() + this.itemTransformer.getNumberOfNodes();
|
|
@@ -178,11 +186,11 @@ class ArrayDecodingTransformer extends ProducerTransformer {
|
|
|
178
186
|
return false;
|
|
179
187
|
}
|
|
180
188
|
get itemTargetType() {
|
|
181
|
-
return TypeGraph_1.derefTypeRef(this._itemTargetTypeRef, this.graph);
|
|
189
|
+
return (0, TypeGraph_1.derefTypeRef)(this._itemTargetTypeRef, this.graph);
|
|
182
190
|
}
|
|
183
191
|
reverse(targetTypeRef, continuationTransformer) {
|
|
184
192
|
if (continuationTransformer !== undefined) {
|
|
185
|
-
return Support_1.panic("Reversing a decoding transformer cannot have a continuation");
|
|
193
|
+
return (0, Support_1.panic)("Reversing a decoding transformer cannot have a continuation");
|
|
186
194
|
}
|
|
187
195
|
const itemTransformer = this.itemTransformer.reverse(this._itemTargetTypeRef, undefined);
|
|
188
196
|
if (this.consumer === undefined) {
|
|
@@ -193,12 +201,12 @@ class ArrayDecodingTransformer extends ProducerTransformer {
|
|
|
193
201
|
}
|
|
194
202
|
}
|
|
195
203
|
reconstitute(builder) {
|
|
196
|
-
return new ArrayDecodingTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)), builder.reconstituteTypeRef(this._itemTargetTypeRef), this.itemTransformer.reconstitute(builder));
|
|
204
|
+
return new ArrayDecodingTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)), builder.reconstituteTypeRef(this._itemTargetTypeRef), this.itemTransformer.reconstitute(builder));
|
|
197
205
|
}
|
|
198
206
|
hashCode() {
|
|
199
207
|
let h = super.hashCode();
|
|
200
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this._itemTargetTypeRef));
|
|
201
|
-
h = collection_utils_1.addHashCode(h, this.itemTransformer.hashCode());
|
|
208
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this._itemTargetTypeRef));
|
|
209
|
+
h = (0, collection_utils_1.addHashCode)(h, this.itemTransformer.hashCode());
|
|
202
210
|
return h;
|
|
203
211
|
}
|
|
204
212
|
equals(other) {
|
|
@@ -206,7 +214,7 @@ class ArrayDecodingTransformer extends ProducerTransformer {
|
|
|
206
214
|
return false;
|
|
207
215
|
if (!(other instanceof ArrayDecodingTransformer))
|
|
208
216
|
return false;
|
|
209
|
-
if (!collection_utils_1.areEqual(this._itemTargetTypeRef, other._itemTargetTypeRef))
|
|
217
|
+
if (!(0, collection_utils_1.areEqual)(this._itemTargetTypeRef, other._itemTargetTypeRef))
|
|
210
218
|
return false;
|
|
211
219
|
return this.itemTransformer.equals(other.itemTransformer);
|
|
212
220
|
}
|
|
@@ -217,6 +225,8 @@ class ArrayDecodingTransformer extends ProducerTransformer {
|
|
|
217
225
|
}
|
|
218
226
|
exports.ArrayDecodingTransformer = ArrayDecodingTransformer;
|
|
219
227
|
class ArrayEncodingTransformer extends Transformer {
|
|
228
|
+
_itemTargetTypeRef;
|
|
229
|
+
itemTransformer;
|
|
220
230
|
constructor(graph, sourceTypeRef, _itemTargetTypeRef, itemTransformer) {
|
|
221
231
|
super("encode-array", graph, sourceTypeRef);
|
|
222
232
|
this._itemTargetTypeRef = _itemTargetTypeRef;
|
|
@@ -225,7 +235,7 @@ class ArrayEncodingTransformer extends Transformer {
|
|
|
225
235
|
getChildren() {
|
|
226
236
|
const children = super.getChildren();
|
|
227
237
|
children.add(this.itemTargetType);
|
|
228
|
-
return collection_utils_1.setUnionInto(children, this.itemTransformer.getChildren());
|
|
238
|
+
return (0, collection_utils_1.setUnionInto)(children, this.itemTransformer.getChildren());
|
|
229
239
|
}
|
|
230
240
|
getNumberOfNodes() {
|
|
231
241
|
return super.getNumberOfNodes() + this.itemTransformer.getNumberOfNodes();
|
|
@@ -234,25 +244,25 @@ class ArrayEncodingTransformer extends Transformer {
|
|
|
234
244
|
return false;
|
|
235
245
|
}
|
|
236
246
|
get itemTargetType() {
|
|
237
|
-
return TypeGraph_1.derefTypeRef(this._itemTargetTypeRef, this.graph);
|
|
247
|
+
return (0, TypeGraph_1.derefTypeRef)(this._itemTargetTypeRef, this.graph);
|
|
238
248
|
}
|
|
239
249
|
reverse(_targetTypeRef, _continuationTransformer) {
|
|
240
|
-
return Support_1.panic("Can't reverse array encoding transformer");
|
|
250
|
+
return (0, Support_1.panic)("Can't reverse array encoding transformer");
|
|
241
251
|
}
|
|
242
252
|
reconstitute(builder) {
|
|
243
253
|
return new ArrayEncodingTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), builder.reconstituteTypeRef(this._itemTargetTypeRef), this.itemTransformer.reconstitute(builder));
|
|
244
254
|
}
|
|
245
255
|
hashCode() {
|
|
246
256
|
let h = super.hashCode();
|
|
247
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this._itemTargetTypeRef));
|
|
248
|
-
return collection_utils_1.addHashCode(h, this.itemTransformer.hashCode());
|
|
257
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this._itemTargetTypeRef));
|
|
258
|
+
return (0, collection_utils_1.addHashCode)(h, this.itemTransformer.hashCode());
|
|
249
259
|
}
|
|
250
260
|
equals(other) {
|
|
251
261
|
if (!super.equals(other))
|
|
252
262
|
return false;
|
|
253
263
|
if (!(other instanceof ArrayEncodingTransformer))
|
|
254
264
|
return false;
|
|
255
|
-
if (!collection_utils_1.areEqual(this._itemTargetTypeRef, other._itemTargetTypeRef))
|
|
265
|
+
if (!(0, collection_utils_1.areEqual)(this._itemTargetTypeRef, other._itemTargetTypeRef))
|
|
256
266
|
return false;
|
|
257
267
|
return this.itemTransformer.equals(other.itemTransformer);
|
|
258
268
|
}
|
|
@@ -263,15 +273,16 @@ class ArrayEncodingTransformer extends Transformer {
|
|
|
263
273
|
}
|
|
264
274
|
exports.ArrayEncodingTransformer = ArrayEncodingTransformer;
|
|
265
275
|
class ChoiceTransformer extends Transformer {
|
|
276
|
+
transformers;
|
|
266
277
|
constructor(graph, sourceTypeRef, transformers) {
|
|
267
278
|
super("choice", graph, sourceTypeRef);
|
|
268
279
|
this.transformers = transformers;
|
|
269
|
-
Support_1.assert(transformers.length > 0, "Choice must have at least one transformer");
|
|
280
|
+
(0, Support_1.assert)(transformers.length > 0, "Choice must have at least one transformer");
|
|
270
281
|
}
|
|
271
282
|
getChildren() {
|
|
272
283
|
let children = super.getChildren();
|
|
273
284
|
for (const xfer of this.transformers) {
|
|
274
|
-
collection_utils_1.setUnionInto(children, xfer.getChildren());
|
|
285
|
+
(0, collection_utils_1.setUnionInto)(children, xfer.getChildren());
|
|
275
286
|
}
|
|
276
287
|
return children;
|
|
277
288
|
}
|
|
@@ -305,11 +316,11 @@ class ChoiceTransformer extends Transformer {
|
|
|
305
316
|
return false;
|
|
306
317
|
if (!(other instanceof ChoiceTransformer))
|
|
307
318
|
return false;
|
|
308
|
-
return collection_utils_1.areEqual(this.transformers, other.transformers);
|
|
319
|
+
return (0, collection_utils_1.areEqual)(this.transformers, other.transformers);
|
|
309
320
|
}
|
|
310
321
|
hashCode() {
|
|
311
322
|
const h = super.hashCode();
|
|
312
|
-
return collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.transformers));
|
|
323
|
+
return (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.transformers));
|
|
313
324
|
}
|
|
314
325
|
debugPrintContinuations(indent) {
|
|
315
326
|
for (const xfer of this.transformers) {
|
|
@@ -319,6 +330,13 @@ class ChoiceTransformer extends Transformer {
|
|
|
319
330
|
}
|
|
320
331
|
exports.ChoiceTransformer = ChoiceTransformer;
|
|
321
332
|
class DecodingChoiceTransformer extends Transformer {
|
|
333
|
+
nullTransformer;
|
|
334
|
+
integerTransformer;
|
|
335
|
+
doubleTransformer;
|
|
336
|
+
boolTransformer;
|
|
337
|
+
stringTransformer;
|
|
338
|
+
arrayTransformer;
|
|
339
|
+
objectTransformer;
|
|
322
340
|
constructor(graph, sourceTypeRef, nullTransformer, integerTransformer, doubleTransformer, boolTransformer, stringTransformer, arrayTransformer, objectTransformer) {
|
|
323
341
|
super("decoding-choice", graph, sourceTypeRef);
|
|
324
342
|
this.nullTransformer = nullTransformer;
|
|
@@ -348,7 +366,7 @@ class DecodingChoiceTransformer extends Transformer {
|
|
|
348
366
|
getChildren() {
|
|
349
367
|
let children = super.getChildren();
|
|
350
368
|
for (const xfer of this.transformers) {
|
|
351
|
-
collection_utils_1.setUnionInto(children, xfer.getChildren());
|
|
369
|
+
(0, collection_utils_1.setUnionInto)(children, xfer.getChildren());
|
|
352
370
|
}
|
|
353
371
|
return children;
|
|
354
372
|
}
|
|
@@ -363,7 +381,7 @@ class DecodingChoiceTransformer extends Transformer {
|
|
|
363
381
|
return false;
|
|
364
382
|
}
|
|
365
383
|
reverse(targetTypeRef, continuationTransformer) {
|
|
366
|
-
Support_1.assert(continuationTransformer === undefined, "Reversing a decoding transformer can't have a target transformer");
|
|
384
|
+
(0, Support_1.assert)(continuationTransformer === undefined, "Reversing a decoding transformer can't have a target transformer");
|
|
367
385
|
let transformers = new Map();
|
|
368
386
|
let memberMatchTransformers = new Map();
|
|
369
387
|
function addCase(reversed) {
|
|
@@ -407,7 +425,7 @@ class DecodingChoiceTransformer extends Transformer {
|
|
|
407
425
|
// just pick the "simplest" non-failing one, being the one with the least number
|
|
408
426
|
// of nodes.
|
|
409
427
|
function filter(xfers) {
|
|
410
|
-
Support_1.assert(xfers.length > 0, "Must have at least one transformer");
|
|
428
|
+
(0, Support_1.assert)(xfers.length > 0, "Must have at least one transformer");
|
|
411
429
|
const nonfailing = xfers.filter(xfer => {
|
|
412
430
|
// For member match transformers we're deciding between
|
|
413
431
|
// multiple that match against the same member, so the fact
|
|
@@ -423,7 +441,7 @@ class DecodingChoiceTransformer extends Transformer {
|
|
|
423
441
|
});
|
|
424
442
|
if (nonfailing.length === 0)
|
|
425
443
|
return xfers;
|
|
426
|
-
const smallest = collection_utils_1.arraySortByInto(nonfailing.map(x => [x.getNumberOfNodes(), x]), ([c, _]) => c)[0][1];
|
|
444
|
+
const smallest = (0, collection_utils_1.arraySortByInto)(nonfailing.map(x => [x.getNumberOfNodes(), x]), ([c, _]) => c)[0][1];
|
|
427
445
|
return [smallest];
|
|
428
446
|
}
|
|
429
447
|
this.transformers.forEach(reverseAndAdd);
|
|
@@ -448,31 +466,31 @@ class DecodingChoiceTransformer extends Transformer {
|
|
|
448
466
|
return false;
|
|
449
467
|
if (!(other instanceof DecodingChoiceTransformer))
|
|
450
468
|
return false;
|
|
451
|
-
if (!collection_utils_1.areEqual(this.nullTransformer, other.nullTransformer))
|
|
469
|
+
if (!(0, collection_utils_1.areEqual)(this.nullTransformer, other.nullTransformer))
|
|
452
470
|
return false;
|
|
453
|
-
if (!collection_utils_1.areEqual(this.integerTransformer, other.integerTransformer))
|
|
471
|
+
if (!(0, collection_utils_1.areEqual)(this.integerTransformer, other.integerTransformer))
|
|
454
472
|
return false;
|
|
455
|
-
if (!collection_utils_1.areEqual(this.doubleTransformer, other.doubleTransformer))
|
|
473
|
+
if (!(0, collection_utils_1.areEqual)(this.doubleTransformer, other.doubleTransformer))
|
|
456
474
|
return false;
|
|
457
|
-
if (!collection_utils_1.areEqual(this.boolTransformer, other.boolTransformer))
|
|
475
|
+
if (!(0, collection_utils_1.areEqual)(this.boolTransformer, other.boolTransformer))
|
|
458
476
|
return false;
|
|
459
|
-
if (!collection_utils_1.areEqual(this.stringTransformer, other.stringTransformer))
|
|
477
|
+
if (!(0, collection_utils_1.areEqual)(this.stringTransformer, other.stringTransformer))
|
|
460
478
|
return false;
|
|
461
|
-
if (!collection_utils_1.areEqual(this.arrayTransformer, other.arrayTransformer))
|
|
479
|
+
if (!(0, collection_utils_1.areEqual)(this.arrayTransformer, other.arrayTransformer))
|
|
462
480
|
return false;
|
|
463
|
-
if (!collection_utils_1.areEqual(this.objectTransformer, other.objectTransformer))
|
|
481
|
+
if (!(0, collection_utils_1.areEqual)(this.objectTransformer, other.objectTransformer))
|
|
464
482
|
return false;
|
|
465
483
|
return true;
|
|
466
484
|
}
|
|
467
485
|
hashCode() {
|
|
468
486
|
let h = super.hashCode();
|
|
469
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.nullTransformer));
|
|
470
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.integerTransformer));
|
|
471
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.doubleTransformer));
|
|
472
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.boolTransformer));
|
|
473
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.stringTransformer));
|
|
474
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.arrayTransformer));
|
|
475
|
-
h = collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.objectTransformer));
|
|
487
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.nullTransformer));
|
|
488
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.integerTransformer));
|
|
489
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.doubleTransformer));
|
|
490
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.boolTransformer));
|
|
491
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.stringTransformer));
|
|
492
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.arrayTransformer));
|
|
493
|
+
h = (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.objectTransformer));
|
|
476
494
|
return h;
|
|
477
495
|
}
|
|
478
496
|
debugPrintContinuations(indent) {
|
|
@@ -483,14 +501,15 @@ class DecodingChoiceTransformer extends Transformer {
|
|
|
483
501
|
}
|
|
484
502
|
exports.DecodingChoiceTransformer = DecodingChoiceTransformer;
|
|
485
503
|
class UnionMemberMatchTransformer extends MatchTransformer {
|
|
504
|
+
memberTypeRef;
|
|
486
505
|
constructor(graph, sourceTypeRef, transformer, memberTypeRef) {
|
|
487
506
|
super("union-member-match", graph, sourceTypeRef, transformer);
|
|
488
507
|
this.memberTypeRef = memberTypeRef;
|
|
489
508
|
}
|
|
490
509
|
get sourceType() {
|
|
491
|
-
const t = TypeGraph_1.derefTypeRef(this.sourceTypeRef, this.graph);
|
|
510
|
+
const t = (0, TypeGraph_1.derefTypeRef)(this.sourceTypeRef, this.graph);
|
|
492
511
|
if (!(t instanceof Type_1.UnionType)) {
|
|
493
|
-
return Support_1.panic("The source of a union member match transformer must be a union type");
|
|
512
|
+
return (0, Support_1.panic)("The source of a union member match transformer must be a union type");
|
|
494
513
|
}
|
|
495
514
|
return t;
|
|
496
515
|
}
|
|
@@ -498,13 +517,13 @@ class UnionMemberMatchTransformer extends MatchTransformer {
|
|
|
498
517
|
return true;
|
|
499
518
|
}
|
|
500
519
|
get memberType() {
|
|
501
|
-
return TypeGraph_1.derefTypeRef(this.memberTypeRef, this.graph);
|
|
520
|
+
return (0, TypeGraph_1.derefTypeRef)(this.memberTypeRef, this.graph);
|
|
502
521
|
}
|
|
503
522
|
getChildren() {
|
|
504
523
|
return super.getChildren().add(this.memberType);
|
|
505
524
|
}
|
|
506
525
|
reverse(_targetTypeRef, _continuationTransformer) {
|
|
507
|
-
return Support_1.panic("Can't reverse union member match transformer");
|
|
526
|
+
return (0, Support_1.panic)("Can't reverse union member match transformer");
|
|
508
527
|
}
|
|
509
528
|
reconstitute(builder) {
|
|
510
529
|
return new UnionMemberMatchTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), this.transformer.reconstitute(builder), builder.reconstituteTypeRef(this.memberTypeRef));
|
|
@@ -518,7 +537,7 @@ class UnionMemberMatchTransformer extends MatchTransformer {
|
|
|
518
537
|
}
|
|
519
538
|
hashCode() {
|
|
520
539
|
const h = super.hashCode();
|
|
521
|
-
return collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.memberTypeRef));
|
|
540
|
+
return (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.memberTypeRef));
|
|
522
541
|
}
|
|
523
542
|
debugDescription() {
|
|
524
543
|
return `${super.debugDescription()} - member: ${debugStringForType(this.memberType)}`;
|
|
@@ -529,14 +548,15 @@ exports.UnionMemberMatchTransformer = UnionMemberMatchTransformer;
|
|
|
529
548
|
* This matches strings and enum cases.
|
|
530
549
|
*/
|
|
531
550
|
class StringMatchTransformer extends MatchTransformer {
|
|
551
|
+
stringCase;
|
|
532
552
|
constructor(graph, sourceTypeRef, transformer, stringCase) {
|
|
533
553
|
super("string-match", graph, sourceTypeRef, transformer);
|
|
534
554
|
this.stringCase = stringCase;
|
|
535
555
|
}
|
|
536
556
|
get sourceType() {
|
|
537
|
-
const t = TypeGraph_1.derefTypeRef(this.sourceTypeRef, this.graph);
|
|
557
|
+
const t = (0, TypeGraph_1.derefTypeRef)(this.sourceTypeRef, this.graph);
|
|
538
558
|
if (!(t instanceof Type_1.EnumType) && !(t instanceof Type_1.PrimitiveType && t.kind === "string")) {
|
|
539
|
-
return Support_1.panic("The source of a string match transformer must be an enum or string type");
|
|
559
|
+
return (0, Support_1.panic)("The source of a string match transformer must be an enum or string type");
|
|
540
560
|
}
|
|
541
561
|
return t;
|
|
542
562
|
}
|
|
@@ -558,7 +578,7 @@ class StringMatchTransformer extends MatchTransformer {
|
|
|
558
578
|
}
|
|
559
579
|
hashCode() {
|
|
560
580
|
const h = super.hashCode();
|
|
561
|
-
return collection_utils_1.addHashCode(h, collection_utils_1.hashString(this.stringCase));
|
|
581
|
+
return (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashString)(this.stringCase));
|
|
562
582
|
}
|
|
563
583
|
debugDescription() {
|
|
564
584
|
return `${super.debugDescription()} - case: ${this.stringCase}`;
|
|
@@ -574,7 +594,7 @@ class UnionInstantiationTransformer extends Transformer {
|
|
|
574
594
|
}
|
|
575
595
|
reverse(targetTypeRef, continuationTransformer) {
|
|
576
596
|
if (continuationTransformer === undefined) {
|
|
577
|
-
return Support_1.panic("Union instantiation transformer reverse must have a continuation");
|
|
597
|
+
return (0, Support_1.panic)("Union instantiation transformer reverse must have a continuation");
|
|
578
598
|
}
|
|
579
599
|
return new UnionMemberMatchTransformer(this.graph, targetTypeRef, continuationTransformer, this.sourceTypeRef);
|
|
580
600
|
}
|
|
@@ -592,6 +612,7 @@ exports.UnionInstantiationTransformer = UnionInstantiationTransformer;
|
|
|
592
612
|
* Produces a string or an enum case.
|
|
593
613
|
*/
|
|
594
614
|
class StringProducerTransformer extends ProducerTransformer {
|
|
615
|
+
result;
|
|
595
616
|
constructor(graph, sourceTypeRef, consumer, result) {
|
|
596
617
|
super("string-producer", graph, sourceTypeRef, consumer);
|
|
597
618
|
this.result = result;
|
|
@@ -601,7 +622,7 @@ class StringProducerTransformer extends ProducerTransformer {
|
|
|
601
622
|
}
|
|
602
623
|
reverse(targetTypeRef, continuationTransformer) {
|
|
603
624
|
if (continuationTransformer === undefined) {
|
|
604
|
-
return Support_1.panic("Reversing a string producer transformer must have a continuation");
|
|
625
|
+
return (0, Support_1.panic)("Reversing a string producer transformer must have a continuation");
|
|
605
626
|
}
|
|
606
627
|
if (this.consumer === undefined) {
|
|
607
628
|
return new StringMatchTransformer(this.graph, targetTypeRef, continuationTransformer, this.result);
|
|
@@ -611,7 +632,7 @@ class StringProducerTransformer extends ProducerTransformer {
|
|
|
611
632
|
}
|
|
612
633
|
}
|
|
613
634
|
reconstitute(builder) {
|
|
614
|
-
return new StringProducerTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)), this.result);
|
|
635
|
+
return new StringProducerTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)), this.result);
|
|
615
636
|
}
|
|
616
637
|
equals(other) {
|
|
617
638
|
if (!super.equals(other))
|
|
@@ -622,7 +643,7 @@ class StringProducerTransformer extends ProducerTransformer {
|
|
|
622
643
|
}
|
|
623
644
|
hashCode() {
|
|
624
645
|
const h = super.hashCode();
|
|
625
|
-
return collection_utils_1.addHashCode(h, collection_utils_1.hashCodeOf(this.consumer));
|
|
646
|
+
return (0, collection_utils_1.addHashCode)(h, (0, collection_utils_1.hashCodeOf)(this.consumer));
|
|
626
647
|
}
|
|
627
648
|
debugDescription() {
|
|
628
649
|
return `${super.debugDescription()} - result: ${this.result}`;
|
|
@@ -645,7 +666,7 @@ class ParseStringTransformer extends ProducerTransformer {
|
|
|
645
666
|
}
|
|
646
667
|
}
|
|
647
668
|
reconstitute(builder) {
|
|
648
|
-
return new ParseStringTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)));
|
|
669
|
+
return new ParseStringTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)));
|
|
649
670
|
}
|
|
650
671
|
equals(other) {
|
|
651
672
|
if (!super.equals(other))
|
|
@@ -670,7 +691,7 @@ class StringifyTransformer extends ProducerTransformer {
|
|
|
670
691
|
}
|
|
671
692
|
}
|
|
672
693
|
reconstitute(builder) {
|
|
673
|
-
return new StringifyTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)));
|
|
694
|
+
return new StringifyTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)));
|
|
674
695
|
}
|
|
675
696
|
equals(other) {
|
|
676
697
|
if (!super.equals(other))
|
|
@@ -680,6 +701,8 @@ class StringifyTransformer extends ProducerTransformer {
|
|
|
680
701
|
}
|
|
681
702
|
exports.StringifyTransformer = StringifyTransformer;
|
|
682
703
|
class MinMaxLengthCheckTransformer extends ProducerTransformer {
|
|
704
|
+
minLength;
|
|
705
|
+
maxLength;
|
|
683
706
|
constructor(graph, sourceTypeRef, consumer, minLength, maxLength) {
|
|
684
707
|
super("min-max-length-check", graph, sourceTypeRef, consumer);
|
|
685
708
|
this.minLength = minLength;
|
|
@@ -697,7 +720,7 @@ class MinMaxLengthCheckTransformer extends ProducerTransformer {
|
|
|
697
720
|
}
|
|
698
721
|
}
|
|
699
722
|
reconstitute(builder) {
|
|
700
|
-
return new MinMaxLengthCheckTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)), this.minLength, this.maxLength);
|
|
723
|
+
return new MinMaxLengthCheckTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)), this.minLength, this.maxLength);
|
|
701
724
|
}
|
|
702
725
|
equals(other) {
|
|
703
726
|
if (!super.equals(other))
|
|
@@ -709,6 +732,8 @@ class MinMaxLengthCheckTransformer extends ProducerTransformer {
|
|
|
709
732
|
}
|
|
710
733
|
exports.MinMaxLengthCheckTransformer = MinMaxLengthCheckTransformer;
|
|
711
734
|
class MinMaxValueTransformer extends ProducerTransformer {
|
|
735
|
+
minimum;
|
|
736
|
+
maximum;
|
|
712
737
|
constructor(graph, sourceTypeRef, consumer, minimum, maximum) {
|
|
713
738
|
super("min-max-value-check", graph, sourceTypeRef, consumer);
|
|
714
739
|
this.minimum = minimum;
|
|
@@ -726,7 +751,7 @@ class MinMaxValueTransformer extends ProducerTransformer {
|
|
|
726
751
|
}
|
|
727
752
|
}
|
|
728
753
|
reconstitute(builder) {
|
|
729
|
-
return new MinMaxValueTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), collection_utils_1.definedMap(this.consumer, xfer => xfer.reconstitute(builder)), this.minimum, this.maximum);
|
|
754
|
+
return new MinMaxValueTransformer(builder.typeGraph, builder.reconstituteTypeRef(this.sourceTypeRef), (0, collection_utils_1.definedMap)(this.consumer, xfer => xfer.reconstitute(builder)), this.minimum, this.maximum);
|
|
730
755
|
}
|
|
731
756
|
equals(other) {
|
|
732
757
|
if (!super.equals(other))
|
|
@@ -736,6 +761,9 @@ class MinMaxValueTransformer extends ProducerTransformer {
|
|
|
736
761
|
}
|
|
737
762
|
exports.MinMaxValueTransformer = MinMaxValueTransformer;
|
|
738
763
|
class Transformation {
|
|
764
|
+
_graph;
|
|
765
|
+
_targetTypeRef;
|
|
766
|
+
transformer;
|
|
739
767
|
constructor(_graph, _targetTypeRef, transformer) {
|
|
740
768
|
this._graph = _graph;
|
|
741
769
|
this._targetTypeRef = _targetTypeRef;
|
|
@@ -745,7 +773,7 @@ class Transformation {
|
|
|
745
773
|
return this.transformer.sourceType;
|
|
746
774
|
}
|
|
747
775
|
get targetType() {
|
|
748
|
-
return TypeGraph_1.derefTypeRef(this._targetTypeRef, this._graph);
|
|
776
|
+
return (0, TypeGraph_1.derefTypeRef)(this._targetTypeRef, this._graph);
|
|
749
777
|
}
|
|
750
778
|
get reverse() {
|
|
751
779
|
return new Transformation(this._graph, this.transformer.sourceTypeRef, this.transformer.reverse(this._targetTypeRef, undefined));
|
|
@@ -762,8 +790,8 @@ class Transformation {
|
|
|
762
790
|
return this._targetTypeRef === other._targetTypeRef && this.transformer.equals(other.transformer);
|
|
763
791
|
}
|
|
764
792
|
hashCode() {
|
|
765
|
-
let h = collection_utils_1.hashCodeOf(this._targetTypeRef);
|
|
766
|
-
h = collection_utils_1.addHashCode(h, this.transformer.hashCode());
|
|
793
|
+
let h = (0, collection_utils_1.hashCodeOf)(this._targetTypeRef);
|
|
794
|
+
h = (0, collection_utils_1.addHashCode)(h, this.transformer.hashCode());
|
|
767
795
|
return h;
|
|
768
796
|
}
|
|
769
797
|
debugPrint() {
|