@fncts/schema 0.0.23 → 0.0.24
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/AST.d.ts +60 -29
- package/ASTAnnotationMap.d.ts +4 -1
- package/ParseError/ParseError.d.ts +28 -13
- package/_cjs/AST.cjs +279 -137
- package/_cjs/AST.cjs.map +1 -1
- package/_cjs/ASTAnnotation.cjs +5 -3
- package/_cjs/ASTAnnotation.cjs.map +1 -1
- package/_cjs/ASTAnnotationMap.cjs +18 -9
- package/_cjs/ASTAnnotationMap.cjs.map +1 -1
- package/_cjs/InvalidInterpretationError.cjs +1 -6
- package/_cjs/InvalidInterpretationError.cjs.map +1 -1
- package/_cjs/ParseError/ParseError.cjs +91 -14
- package/_cjs/ParseError/ParseError.cjs.map +1 -1
- package/_cjs/Schema/api/hashMap.cjs +1 -1
- package/_cjs/Schema/api/hashMap.cjs.map +1 -1
- package/_cjs/Schema/api/hashSet.cjs +1 -1
- package/_cjs/Schema/api/hashSet.cjs.map +1 -1
- package/_cjs/Schema/api/list.cjs +3 -1
- package/_cjs/Schema/api/list.cjs.map +1 -1
- package/_cjs/Schema/api/map.cjs +1 -1
- package/_cjs/Schema/api/map.cjs.map +1 -1
- package/_cjs/Schema/api/set.cjs +1 -1
- package/_cjs/Schema/api/set.cjs.map +1 -1
- package/_cjs/Schema/definition.cjs +3 -4
- package/_cjs/Schema/definition.cjs.map +1 -1
- package/_mjs/AST.mjs +277 -136
- package/_mjs/AST.mjs.map +1 -1
- package/_mjs/ASTAnnotation.mjs +5 -3
- package/_mjs/ASTAnnotation.mjs.map +1 -1
- package/_mjs/ASTAnnotationMap.mjs +18 -9
- package/_mjs/ASTAnnotationMap.mjs.map +1 -1
- package/_mjs/InvalidInterpretationError.mjs +1 -6
- package/_mjs/InvalidInterpretationError.mjs.map +1 -1
- package/_mjs/ParseError/ParseError.mjs +90 -14
- package/_mjs/ParseError/ParseError.mjs.map +1 -1
- package/_mjs/Schema/api/hashMap.mjs +1 -1
- package/_mjs/Schema/api/hashMap.mjs.map +1 -1
- package/_mjs/Schema/api/hashSet.mjs +1 -1
- package/_mjs/Schema/api/hashSet.mjs.map +1 -1
- package/_mjs/Schema/api/list.mjs +3 -1
- package/_mjs/Schema/api/list.mjs.map +1 -1
- package/_mjs/Schema/api/map.mjs +1 -1
- package/_mjs/Schema/api/map.mjs.map +1 -1
- package/_mjs/Schema/api/set.mjs +1 -1
- package/_mjs/Schema/api/set.mjs.map +1 -1
- package/_mjs/Schema/definition.mjs +2 -3
- package/_mjs/Schema/definition.mjs.map +1 -1
- package/_src/AST.ts +226 -28
- package/_src/ASTAnnotationMap.ts +14 -1
- package/_src/ParseError/ParseError.ts +128 -13
- package/_src/Schema/api/hashMap.ts +1 -1
- package/_src/Schema/api/hashSet.ts +1 -1
- package/_src/Schema/api/list.ts +3 -1
- package/_src/Schema/api/map.ts +1 -1
- package/_src/Schema/api/set.ts +1 -1
- package/package.json +3 -3
package/_cjs/AST.cjs
CHANGED
|
@@ -31,6 +31,7 @@ exports.getPropertySignatures = void 0;
|
|
|
31
31
|
exports.getSearchTree = getSearchTree;
|
|
32
32
|
exports.getTo = void 0;
|
|
33
33
|
exports.getWeight = getWeight;
|
|
34
|
+
exports.isAST = isAST;
|
|
34
35
|
exports.isBigIntKeyword = isBigIntKeyword;
|
|
35
36
|
exports.isBooleanKeyword = isBooleanKeyword;
|
|
36
37
|
exports.isDeclaration = isDeclaration;
|
|
@@ -48,26 +49,28 @@ exports.partial = void 0;
|
|
|
48
49
|
exports.pick = pick;
|
|
49
50
|
exports.setAnnotation = setAnnotation;
|
|
50
51
|
exports.voidKeyword = exports.unknownRecord = exports.unknownKeyword = exports.unknownArray = exports.undefinedKeyword = exports.symbolKeyword = exports.stringKeyword = void 0;
|
|
51
|
-
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/
|
|
52
|
-
var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/schema/
|
|
53
|
-
var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/
|
|
54
|
-
var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/
|
|
55
|
-
var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/
|
|
56
|
-
var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/
|
|
57
|
-
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/
|
|
58
|
-
var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/
|
|
59
|
-
var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/
|
|
60
|
-
var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/
|
|
61
|
-
var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/
|
|
62
|
-
var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/
|
|
63
|
-
var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/
|
|
64
|
-
var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/collection/
|
|
65
|
-
var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Maybe/
|
|
52
|
+
var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Equatable/definition"));
|
|
53
|
+
var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/schema/Show"));
|
|
54
|
+
var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/util/predicates"));
|
|
55
|
+
var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/schema/ASTAnnotation"));
|
|
56
|
+
var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/collection/immutable/Vector/definition"));
|
|
57
|
+
var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/collection/immutable/Vector/api"));
|
|
58
|
+
var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
|
|
59
|
+
var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/schema/ParseResult"));
|
|
60
|
+
var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/schema/ParseError/ParseError"));
|
|
61
|
+
var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/number/instances"));
|
|
62
|
+
var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Ord/api/contramap"));
|
|
63
|
+
var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Ord/api"));
|
|
64
|
+
var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Ord/api/max"));
|
|
65
|
+
var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/collection/Iterable/api"));
|
|
66
|
+
var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Maybe/destructors"));
|
|
67
|
+
var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Maybe/definition"));
|
|
68
|
+
var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/collection/immutable/Vector/internal"));
|
|
69
|
+
var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/base/data/Maybe/api"));
|
|
66
70
|
var _Showable = /*#__PURE__*/require("@fncts/base/data/Showable");
|
|
67
71
|
var _utils = /*#__PURE__*/require("@fncts/schema/utils");
|
|
68
72
|
var _ASTAnnotationMap = /*#__PURE__*/require("./ASTAnnotationMap.cjs");
|
|
69
73
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
70
|
-
var _a;
|
|
71
74
|
const fileName_1 = "(@fncts/schema) src/AST.ts";
|
|
72
75
|
const createLiteral = exports.createLiteral = createLiteral_1;
|
|
73
76
|
const isLiteral = exports.isLiteral = isLiteral_1;
|
|
@@ -92,9 +95,7 @@ const getFrom = exports.getFrom = getFrom_1;
|
|
|
92
95
|
const getTo = exports.getTo = getTo_1;
|
|
93
96
|
const ASTTypeId = exports.ASTTypeId = /*#__PURE__*/Symbol.for("fncts.schema.AST");
|
|
94
97
|
class Annotated {
|
|
95
|
-
|
|
96
|
-
this.annotations = _ASTAnnotationMap.ASTAnnotationMap.empty;
|
|
97
|
-
}
|
|
98
|
+
annotations = _ASTAnnotationMap.ASTAnnotationMap.empty;
|
|
98
99
|
}
|
|
99
100
|
/**
|
|
100
101
|
* @tsplus type fncts.schema.AST
|
|
@@ -102,23 +103,25 @@ class Annotated {
|
|
|
102
103
|
*/
|
|
103
104
|
exports.Annotated = Annotated;
|
|
104
105
|
class AST extends Annotated {
|
|
105
|
-
|
|
106
|
-
super(...arguments);
|
|
107
|
-
this[_a] = ASTTypeId;
|
|
108
|
-
}
|
|
106
|
+
[ASTTypeId] = ASTTypeId;
|
|
109
107
|
toString(verbose = false) {
|
|
110
|
-
return
|
|
108
|
+
return tsplus_module_2.showAST(verbose)(this);
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
|
-
exports.AST = AST;
|
|
114
|
-
_a = ASTTypeId;
|
|
115
111
|
/**
|
|
116
112
|
* @tsplus static fncts.schema.ASTOps concrete
|
|
117
113
|
* @tsplus macro remove
|
|
118
114
|
*/
|
|
115
|
+
exports.AST = AST;
|
|
119
116
|
function concrete(_) {
|
|
120
117
|
//
|
|
121
118
|
}
|
|
119
|
+
function isAST(u) {
|
|
120
|
+
return tsplus_module_3.isObject(u) && ASTTypeId in u;
|
|
121
|
+
}
|
|
122
|
+
function hasTag(u, tag) {
|
|
123
|
+
return isAST(u) && u._tag === tag;
|
|
124
|
+
}
|
|
122
125
|
function getAnnotations(key) {
|
|
123
126
|
return self => {
|
|
124
127
|
return self.annotations.get(key);
|
|
@@ -131,17 +134,24 @@ function getAnnotations(key) {
|
|
|
131
134
|
* @tsplus type fncts.schema.AST.Declaration
|
|
132
135
|
*/
|
|
133
136
|
class Declaration extends AST {
|
|
137
|
+
typeParameters;
|
|
138
|
+
decode;
|
|
139
|
+
encode;
|
|
140
|
+
annotations;
|
|
141
|
+
_tag = 0 /* ASTTag.Declaration */;
|
|
134
142
|
constructor(typeParameters, decode, encode, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
135
143
|
super();
|
|
136
144
|
this.typeParameters = typeParameters;
|
|
137
145
|
this.decode = decode;
|
|
138
146
|
this.encode = encode;
|
|
139
147
|
this.annotations = annotations;
|
|
140
|
-
this._tag = 0 /* ASTTag.Declaration */;
|
|
141
148
|
}
|
|
142
149
|
clone(newProperties) {
|
|
143
150
|
return new Declaration(newProperties.typeParameters ?? this.typeParameters, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
|
|
144
151
|
}
|
|
152
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
153
|
+
return hasTag(that, 0 /* ASTTag.Declaration */) && context.comparator(this.typeParameters, that.typeParameters) && context.comparator(this.decode, that.decode) && context.comparator(this.encode, that.encode) && context.comparator(this.annotations, that.annotations);
|
|
154
|
+
}
|
|
145
155
|
}
|
|
146
156
|
/**
|
|
147
157
|
* @tsplus static fncts.schema.ASTOps createDeclaration
|
|
@@ -158,15 +168,20 @@ function isDeclaration(self) {
|
|
|
158
168
|
return self._tag === 0 /* ASTTag.Declaration */;
|
|
159
169
|
}
|
|
160
170
|
class Literal extends AST {
|
|
171
|
+
literal;
|
|
172
|
+
annotations;
|
|
173
|
+
_tag = 1 /* ASTTag.Literal */;
|
|
161
174
|
constructor(literal, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
162
175
|
super();
|
|
163
176
|
this.literal = literal;
|
|
164
177
|
this.annotations = annotations;
|
|
165
|
-
this._tag = 1 /* ASTTag.Literal */;
|
|
166
178
|
}
|
|
167
179
|
clone(newProperties) {
|
|
168
180
|
return new Literal(newProperties.literal ?? this.literal, newProperties.annotations ?? this.annotations);
|
|
169
181
|
}
|
|
182
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
183
|
+
return hasTag(that, 1 /* ASTTag.Literal */) && context.comparator(this.literal, that.literal) && context.comparator(this.annotations, that.annotations);
|
|
184
|
+
}
|
|
170
185
|
}
|
|
171
186
|
/**
|
|
172
187
|
* @tsplus static fncts.schema.ASTOps createLiteral
|
|
@@ -186,15 +201,20 @@ function isLiteral_1(self) {
|
|
|
186
201
|
* UniqueSymbol
|
|
187
202
|
*/
|
|
188
203
|
class UniqueSymbol extends AST {
|
|
204
|
+
symbol;
|
|
205
|
+
annotations;
|
|
206
|
+
_tag = 2 /* ASTTag.UniqueSymbol */;
|
|
189
207
|
constructor(symbol, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
190
208
|
super();
|
|
191
209
|
this.symbol = symbol;
|
|
192
210
|
this.annotations = annotations;
|
|
193
|
-
this._tag = 2 /* ASTTag.UniqueSymbol */;
|
|
194
211
|
}
|
|
195
212
|
clone(newProperties) {
|
|
196
213
|
return new UniqueSymbol(newProperties.symbol ?? this.symbol, newProperties.annotations ?? this.annotations);
|
|
197
214
|
}
|
|
215
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
216
|
+
return hasTag(that, 2 /* ASTTag.UniqueSymbol */) && context.comparator(this.symbol, that.symbol) && context.comparator(this.annotations, that.annotations);
|
|
217
|
+
}
|
|
198
218
|
}
|
|
199
219
|
/**
|
|
200
220
|
* @tsplus static fncts.schema.ASTOps createUniqueSymbol
|
|
@@ -214,113 +234,137 @@ function isUniqueSymbol_1(self) {
|
|
|
214
234
|
* UndefinedKeyword
|
|
215
235
|
*/
|
|
216
236
|
class UndefinedKeyword extends AST {
|
|
237
|
+
annotations;
|
|
238
|
+
_tag = 3 /* ASTTag.UndefinedKeyword */;
|
|
217
239
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
218
240
|
super();
|
|
219
241
|
this.annotations = annotations;
|
|
220
|
-
this._tag = 3 /* ASTTag.UndefinedKeyword */;
|
|
221
242
|
}
|
|
222
243
|
clone(newProperties) {
|
|
223
244
|
return new UndefinedKeyword(newProperties.annotations ?? this.annotations);
|
|
224
245
|
}
|
|
246
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
247
|
+
return hasTag(that, 3 /* ASTTag.UndefinedKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
248
|
+
}
|
|
225
249
|
}
|
|
226
250
|
/**
|
|
227
251
|
* @tsplus static fncts.schema.ASTOps undefinedKeyword
|
|
228
252
|
*/
|
|
229
253
|
exports.UndefinedKeyword = UndefinedKeyword;
|
|
230
|
-
const undefinedKeyword_1 = /*#__PURE__*/new UndefinedKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
254
|
+
const undefinedKeyword_1 = /*#__PURE__*/new UndefinedKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "undefined"));
|
|
231
255
|
const undefinedKeyword = exports.undefinedKeyword = undefinedKeyword_1;
|
|
232
256
|
/*
|
|
233
257
|
* VoidKeyword
|
|
234
258
|
*/
|
|
235
259
|
class VoidKeyword extends AST {
|
|
260
|
+
annotations;
|
|
261
|
+
_tag = 4 /* ASTTag.VoidKeyword */;
|
|
236
262
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
237
263
|
super();
|
|
238
264
|
this.annotations = annotations;
|
|
239
|
-
this._tag = 4 /* ASTTag.VoidKeyword */;
|
|
240
265
|
}
|
|
241
266
|
clone(newProperties) {
|
|
242
267
|
return new VoidKeyword(newProperties.annotations ?? this.annotations);
|
|
243
268
|
}
|
|
269
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
270
|
+
return hasTag(that, 4 /* ASTTag.VoidKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
271
|
+
}
|
|
244
272
|
}
|
|
245
273
|
/**
|
|
246
274
|
* @tsplus static fncts.schema.ASTOps voidKeyword
|
|
247
275
|
*/
|
|
248
276
|
exports.VoidKeyword = VoidKeyword;
|
|
249
|
-
const voidKeyword = exports.voidKeyword = /*#__PURE__*/new VoidKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
277
|
+
const voidKeyword = exports.voidKeyword = /*#__PURE__*/new VoidKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "void"));
|
|
250
278
|
/*
|
|
251
279
|
* NeverKeyword
|
|
252
280
|
*/
|
|
253
281
|
class NeverKeyword extends AST {
|
|
282
|
+
annotations;
|
|
283
|
+
_tag = 5 /* ASTTag.NeverKeyword */;
|
|
254
284
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
255
285
|
super();
|
|
256
286
|
this.annotations = annotations;
|
|
257
|
-
this._tag = 5 /* ASTTag.NeverKeyword */;
|
|
258
287
|
}
|
|
259
288
|
clone(newProperties) {
|
|
260
289
|
return new NeverKeyword(newProperties.annotations ?? this.annotations);
|
|
261
290
|
}
|
|
291
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
292
|
+
return hasTag(that, 5 /* ASTTag.NeverKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
293
|
+
}
|
|
262
294
|
}
|
|
263
295
|
/**
|
|
264
296
|
* @tsplus static fncts.schema.ASTOps neverKeyword
|
|
265
297
|
*/
|
|
266
298
|
exports.NeverKeyword = NeverKeyword;
|
|
267
|
-
const neverKeyword_1 = /*#__PURE__*/new NeverKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
299
|
+
const neverKeyword_1 = /*#__PURE__*/new NeverKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "never"));
|
|
268
300
|
const neverKeyword = exports.neverKeyword = neverKeyword_1;
|
|
269
301
|
/*
|
|
270
302
|
* UnknownKeyword
|
|
271
303
|
*/
|
|
272
304
|
class UnknownKeyword extends AST {
|
|
305
|
+
annotations;
|
|
306
|
+
_tag = 6 /* ASTTag.UnknownKeyword */;
|
|
273
307
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
274
308
|
super();
|
|
275
309
|
this.annotations = annotations;
|
|
276
|
-
this._tag = 6 /* ASTTag.UnknownKeyword */;
|
|
277
310
|
}
|
|
278
311
|
clone(newProperties) {
|
|
279
312
|
return new UnknownKeyword(newProperties.annotations ?? this.annotations);
|
|
280
313
|
}
|
|
314
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
315
|
+
return hasTag(that, 6 /* ASTTag.UnknownKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
316
|
+
}
|
|
281
317
|
}
|
|
282
318
|
/**
|
|
283
319
|
* @tsplus static fncts.schema.ASTOps unknownKeyword
|
|
284
320
|
*/
|
|
285
321
|
exports.UnknownKeyword = UnknownKeyword;
|
|
286
|
-
const unknownKeyword_1 = /*#__PURE__*/new UnknownKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
322
|
+
const unknownKeyword_1 = /*#__PURE__*/new UnknownKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "unknown"));
|
|
287
323
|
const unknownKeyword = exports.unknownKeyword = unknownKeyword_1;
|
|
288
324
|
/*
|
|
289
325
|
* AnyKeyword
|
|
290
326
|
*/
|
|
291
327
|
class AnyKeyword extends AST {
|
|
328
|
+
annotations;
|
|
329
|
+
_tag = 7 /* ASTTag.AnyKeyword */;
|
|
292
330
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
293
331
|
super();
|
|
294
332
|
this.annotations = annotations;
|
|
295
|
-
this._tag = 7 /* ASTTag.AnyKeyword */;
|
|
296
333
|
}
|
|
297
334
|
clone(newProperties) {
|
|
298
335
|
return new AnyKeyword(newProperties.annotations ?? this.annotations);
|
|
299
336
|
}
|
|
337
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
338
|
+
return hasTag(that, 7 /* ASTTag.AnyKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
339
|
+
}
|
|
300
340
|
}
|
|
301
341
|
/**
|
|
302
342
|
* @tsplus static fncts.schema.ASTOps anyKeyword
|
|
303
343
|
*/
|
|
304
344
|
exports.AnyKeyword = AnyKeyword;
|
|
305
|
-
const anyKeyword = exports.anyKeyword = /*#__PURE__*/new AnyKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
345
|
+
const anyKeyword = exports.anyKeyword = /*#__PURE__*/new AnyKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "any"));
|
|
306
346
|
/*
|
|
307
347
|
* StringKeyword
|
|
308
348
|
*/
|
|
309
349
|
class StringKeyword extends AST {
|
|
350
|
+
annotations;
|
|
351
|
+
_tag = 8 /* ASTTag.StringKeyword */;
|
|
310
352
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
311
353
|
super();
|
|
312
354
|
this.annotations = annotations;
|
|
313
|
-
this._tag = 8 /* ASTTag.StringKeyword */;
|
|
314
355
|
}
|
|
315
356
|
clone(newProperties) {
|
|
316
357
|
return new StringKeyword(newProperties.annotations ?? this.annotations);
|
|
317
358
|
}
|
|
359
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
360
|
+
return hasTag(that, 8 /* ASTTag.StringKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
361
|
+
}
|
|
318
362
|
}
|
|
319
363
|
/**
|
|
320
364
|
* @tsplus static fncts.schema.ASTOps stringKeyword
|
|
321
365
|
*/
|
|
322
366
|
exports.StringKeyword = StringKeyword;
|
|
323
|
-
const stringKeyword_1 = /*#__PURE__*/new StringKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
367
|
+
const stringKeyword_1 = /*#__PURE__*/new StringKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "string"));
|
|
324
368
|
const stringKeyword = exports.stringKeyword = stringKeyword_1;
|
|
325
369
|
/**
|
|
326
370
|
* @tsplus fluent fncts.schema.AST isStringKeyword
|
|
@@ -333,20 +377,24 @@ function isStringKeyword_1(self) {
|
|
|
333
377
|
* NumberKeyword
|
|
334
378
|
*/
|
|
335
379
|
class NumberKeyword extends AST {
|
|
380
|
+
annotations;
|
|
381
|
+
_tag = 9 /* ASTTag.NumberKeyword */;
|
|
336
382
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
337
383
|
super();
|
|
338
384
|
this.annotations = annotations;
|
|
339
|
-
this._tag = 9 /* ASTTag.NumberKeyword */;
|
|
340
385
|
}
|
|
341
386
|
clone(newProperties) {
|
|
342
387
|
return new NumberKeyword(newProperties.annotations ?? this.annotations);
|
|
343
388
|
}
|
|
389
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
390
|
+
return hasTag(that, 9 /* ASTTag.NumberKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
391
|
+
}
|
|
344
392
|
}
|
|
345
393
|
/**
|
|
346
394
|
* @tsplus static fncts.schema.ASTOps numberKeyword
|
|
347
395
|
*/
|
|
348
396
|
exports.NumberKeyword = NumberKeyword;
|
|
349
|
-
const numberKeyword_1 = /*#__PURE__*/new NumberKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
397
|
+
const numberKeyword_1 = /*#__PURE__*/new NumberKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "number"));
|
|
350
398
|
const numberKeyword = exports.numberKeyword = numberKeyword_1;
|
|
351
399
|
/**
|
|
352
400
|
* @tsplus fluent fncts.schema.AST isNumberKeyword
|
|
@@ -359,20 +407,24 @@ function isNumberKeyword_1(self) {
|
|
|
359
407
|
* BooleanKeyword
|
|
360
408
|
*/
|
|
361
409
|
class BooleanKeyword extends AST {
|
|
410
|
+
annotations;
|
|
411
|
+
_tag = 10 /* ASTTag.BooleanKeyword */;
|
|
362
412
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
363
413
|
super();
|
|
364
414
|
this.annotations = annotations;
|
|
365
|
-
this._tag = 10 /* ASTTag.BooleanKeyword */;
|
|
366
415
|
}
|
|
367
416
|
clone(newProperties) {
|
|
368
417
|
return new BooleanKeyword(newProperties.annotations ?? this.annotations);
|
|
369
418
|
}
|
|
419
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
420
|
+
return hasTag(that, 10 /* ASTTag.BooleanKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
421
|
+
}
|
|
370
422
|
}
|
|
371
423
|
/**
|
|
372
424
|
* @tsplus static fncts.schema.ASTOps booleanKeyword
|
|
373
425
|
*/
|
|
374
426
|
exports.BooleanKeyword = BooleanKeyword;
|
|
375
|
-
const booleanKeyword = exports.booleanKeyword = /*#__PURE__*/new BooleanKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
427
|
+
const booleanKeyword = exports.booleanKeyword = /*#__PURE__*/new BooleanKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "boolean"));
|
|
376
428
|
/**
|
|
377
429
|
* @tsplus fluent fncts.schema.AST isBooleanKeyword
|
|
378
430
|
*/
|
|
@@ -384,20 +436,24 @@ function isBooleanKeyword(self) {
|
|
|
384
436
|
* BigIntKeyword
|
|
385
437
|
*/
|
|
386
438
|
class BigIntKeyword extends AST {
|
|
439
|
+
annotations;
|
|
440
|
+
_tag = 11 /* ASTTag.BigIntKeyword */;
|
|
387
441
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
388
442
|
super();
|
|
389
443
|
this.annotations = annotations;
|
|
390
|
-
this._tag = 11 /* ASTTag.BigIntKeyword */;
|
|
391
444
|
}
|
|
392
445
|
clone(newProperties) {
|
|
393
446
|
return new BigIntKeyword(newProperties.annotations ?? this.annotations);
|
|
394
447
|
}
|
|
448
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
449
|
+
return hasTag(that, 11 /* ASTTag.BigIntKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
450
|
+
}
|
|
395
451
|
}
|
|
396
452
|
/**
|
|
397
453
|
* @tsplus static fncts.schema.ASTOps bigIntKeyword
|
|
398
454
|
*/
|
|
399
455
|
exports.BigIntKeyword = BigIntKeyword;
|
|
400
|
-
const bigIntKeyword = exports.bigIntKeyword = /*#__PURE__*/new BigIntKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
456
|
+
const bigIntKeyword = exports.bigIntKeyword = /*#__PURE__*/new BigIntKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "bigint"));
|
|
401
457
|
/**
|
|
402
458
|
* @tsplus fluent fncts.schema.AST isBigIntKeyword
|
|
403
459
|
*/
|
|
@@ -409,20 +465,24 @@ function isBigIntKeyword(self) {
|
|
|
409
465
|
* SymbolKeyword
|
|
410
466
|
*/
|
|
411
467
|
class SymbolKeyword extends AST {
|
|
468
|
+
annotations;
|
|
469
|
+
_tag = 12 /* ASTTag.SymbolKeyword */;
|
|
412
470
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
413
471
|
super();
|
|
414
472
|
this.annotations = annotations;
|
|
415
|
-
this._tag = 12 /* ASTTag.SymbolKeyword */;
|
|
416
473
|
}
|
|
417
474
|
clone(newProperties) {
|
|
418
475
|
return new SymbolKeyword(newProperties.annotations ?? this.annotations);
|
|
419
476
|
}
|
|
477
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
478
|
+
return hasTag(that, 12 /* ASTTag.SymbolKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
479
|
+
}
|
|
420
480
|
}
|
|
421
481
|
/**
|
|
422
482
|
* @tsplus static fncts.schema.ASTOps symbolKeyword
|
|
423
483
|
*/
|
|
424
484
|
exports.SymbolKeyword = SymbolKeyword;
|
|
425
|
-
const symbolKeyword_1 = /*#__PURE__*/new SymbolKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
485
|
+
const symbolKeyword_1 = /*#__PURE__*/new SymbolKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "symbol"));
|
|
426
486
|
const symbolKeyword = exports.symbolKeyword = symbolKeyword_1;
|
|
427
487
|
/**
|
|
428
488
|
* @tsplus fluent fncts.schema.AST isSymbolKeyword
|
|
@@ -435,33 +495,42 @@ function isSymbolKeyword_1(self) {
|
|
|
435
495
|
* ObjectKeyword
|
|
436
496
|
*/
|
|
437
497
|
class ObjectKeyword extends AST {
|
|
498
|
+
annotations;
|
|
499
|
+
_tag = 13 /* ASTTag.ObjectKeyword */;
|
|
438
500
|
constructor(annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
439
501
|
super();
|
|
440
502
|
this.annotations = annotations;
|
|
441
|
-
this._tag = 13 /* ASTTag.ObjectKeyword */;
|
|
442
503
|
}
|
|
443
504
|
clone(newProperties) {
|
|
444
505
|
return new ObjectKeyword(newProperties.annotations ?? this.annotations);
|
|
445
506
|
}
|
|
507
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
508
|
+
return hasTag(that, 13 /* ASTTag.ObjectKeyword */) && context.comparator(this.annotations, that.annotations);
|
|
509
|
+
}
|
|
446
510
|
}
|
|
447
511
|
/**
|
|
448
512
|
* @tsplus static fncts.schema.ASTOps objectKeyword
|
|
449
513
|
*/
|
|
450
514
|
exports.ObjectKeyword = ObjectKeyword;
|
|
451
|
-
const objectKeyword = exports.objectKeyword = /*#__PURE__*/new ObjectKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(
|
|
515
|
+
const objectKeyword = exports.objectKeyword = /*#__PURE__*/new ObjectKeyword(/*#__PURE__*/_ASTAnnotationMap.ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "object"));
|
|
452
516
|
/*
|
|
453
517
|
* Enum
|
|
454
518
|
*/
|
|
455
519
|
class Enum extends AST {
|
|
520
|
+
enums;
|
|
521
|
+
annotations;
|
|
522
|
+
_tag = 14 /* ASTTag.Enum */;
|
|
456
523
|
constructor(enums, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
457
524
|
super();
|
|
458
525
|
this.enums = enums;
|
|
459
526
|
this.annotations = annotations;
|
|
460
|
-
this._tag = 14 /* ASTTag.Enum */;
|
|
461
527
|
}
|
|
462
528
|
clone(newProperties) {
|
|
463
529
|
return new Enum(newProperties.enums ?? this.enums, newProperties.annotations ?? this.annotations);
|
|
464
530
|
}
|
|
531
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
532
|
+
return hasTag(that, 14 /* ASTTag.Enum */) && tsplus_module_5.corresponds(that.enums, ([leftName, leftValue], [rightName, rightValue]) => context.comparator(leftName, rightName) && context.comparator(leftValue, rightValue))(this.enums) && context.comparator(this.annotations, that.annotations);
|
|
533
|
+
}
|
|
465
534
|
}
|
|
466
535
|
/**
|
|
467
536
|
* @tsplus static fncts.schema.ASTOps createEnum
|
|
@@ -471,10 +540,15 @@ function createEnum(enums, annotations = _ASTAnnotationMap.ASTAnnotationMap.empt
|
|
|
471
540
|
return new Enum(enums, annotations);
|
|
472
541
|
}
|
|
473
542
|
class TemplateLiteralSpan {
|
|
543
|
+
type;
|
|
544
|
+
literal;
|
|
474
545
|
constructor(type, literal) {
|
|
475
546
|
this.type = type;
|
|
476
547
|
this.literal = literal;
|
|
477
548
|
}
|
|
549
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
550
|
+
return that instanceof TemplateLiteralSpan && context.comparator(this.type, that.type) && context.comparator(this.literal, that.literal);
|
|
551
|
+
}
|
|
478
552
|
toString() {
|
|
479
553
|
switch (this.type._tag) {
|
|
480
554
|
case 8 /* ASTTag.StringKeyword */:
|
|
@@ -489,23 +563,29 @@ class TemplateLiteralSpan {
|
|
|
489
563
|
*/
|
|
490
564
|
exports.TemplateLiteralSpan = TemplateLiteralSpan;
|
|
491
565
|
class TemplateLiteral extends AST {
|
|
566
|
+
head;
|
|
567
|
+
spans;
|
|
568
|
+
annotations;
|
|
569
|
+
_tag = 15 /* ASTTag.TemplateLiteral */;
|
|
492
570
|
constructor(head, spans, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
493
571
|
super();
|
|
494
572
|
this.head = head;
|
|
495
573
|
this.spans = spans;
|
|
496
574
|
this.annotations = annotations;
|
|
497
|
-
this._tag = 15 /* ASTTag.TemplateLiteral */;
|
|
498
575
|
}
|
|
499
576
|
clone(newProperties) {
|
|
500
577
|
return createTemplateLiteral_1(newProperties.head ?? this.head, newProperties.spans ?? this.spans, newProperties.annotations ?? this.annotations);
|
|
501
578
|
}
|
|
579
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
580
|
+
return hasTag(that, 15 /* ASTTag.TemplateLiteral */) && context.comparator(this.head, that.head) && context.comparator(this.spans, that.spans) && context.comparator(this.annotations, that.annotations);
|
|
581
|
+
}
|
|
502
582
|
}
|
|
503
583
|
/**
|
|
504
584
|
* @tsplus static fncts.schema.ASTOps createTemplateLiteral
|
|
505
585
|
*/
|
|
506
586
|
exports.TemplateLiteral = TemplateLiteral;
|
|
507
587
|
function createTemplateLiteral_1(head, spans, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
508
|
-
if (
|
|
588
|
+
if (tsplus_module_6.isNonEmpty(spans)) {
|
|
509
589
|
return new TemplateLiteral(head, spans, annotations);
|
|
510
590
|
} else {
|
|
511
591
|
return createLiteral_1(head, annotations);
|
|
@@ -515,10 +595,15 @@ function createTemplateLiteral_1(head, spans, annotations = _ASTAnnotationMap.AS
|
|
|
515
595
|
* Element
|
|
516
596
|
*/
|
|
517
597
|
class Element {
|
|
598
|
+
type;
|
|
599
|
+
isOptional;
|
|
518
600
|
constructor(type, isOptional) {
|
|
519
601
|
this.type = type;
|
|
520
602
|
this.isOptional = isOptional;
|
|
521
603
|
}
|
|
604
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
605
|
+
return that instanceof Element && context.comparator(this.type, that.type) && context.comparator(this.isOptional, that.isOptional);
|
|
606
|
+
}
|
|
522
607
|
toString() {
|
|
523
608
|
return String(this.type) + (this.isOptional ? "?" : "");
|
|
524
609
|
}
|
|
@@ -534,17 +619,24 @@ function createElement_1(type, isOptional) {
|
|
|
534
619
|
* Tuple
|
|
535
620
|
*/
|
|
536
621
|
class Tuple extends AST {
|
|
622
|
+
elements;
|
|
623
|
+
rest;
|
|
624
|
+
isReadonly;
|
|
625
|
+
annotations;
|
|
626
|
+
_tag = 16 /* ASTTag.Tuple */;
|
|
537
627
|
constructor(elements, rest, isReadonly, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
538
628
|
super();
|
|
539
629
|
this.elements = elements;
|
|
540
630
|
this.rest = rest;
|
|
541
631
|
this.isReadonly = isReadonly;
|
|
542
632
|
this.annotations = annotations;
|
|
543
|
-
this._tag = 16 /* ASTTag.Tuple */;
|
|
544
633
|
}
|
|
545
634
|
clone(newProperties) {
|
|
546
635
|
return new Tuple(newProperties.elements ?? this.elements, newProperties.rest ?? this.rest, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
|
|
547
636
|
}
|
|
637
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
638
|
+
return hasTag(that, 16 /* ASTTag.Tuple */) && context.comparator(this.elements, that.elements) && context.comparator(this.rest, that.rest) && context.comparator(this.isReadonly, that.isReadonly) && context.comparator(this.annotations, that.annotations);
|
|
639
|
+
}
|
|
548
640
|
}
|
|
549
641
|
/**
|
|
550
642
|
* @tsplus static fncts.schema.ASTOps createTuple
|
|
@@ -556,11 +648,16 @@ function createTuple_1(elements, rest, isReadonly, annotations = _ASTAnnotationM
|
|
|
556
648
|
/**
|
|
557
649
|
* @tsplus static fncts.schema.ASTOps unknownArray
|
|
558
650
|
*/
|
|
559
|
-
const unknownArray = exports.unknownArray = /*#__PURE__*/createTuple_1(/*#__PURE__*/
|
|
651
|
+
const unknownArray = exports.unknownArray = /*#__PURE__*/createTuple_1(/*#__PURE__*/tsplus_module_6.empty(), /*#__PURE__*/tsplus_module_7.just(/*#__PURE__*/tsplus_module_6.vector(unknownKeyword_1), fileName_1 + ":779:65"), true);
|
|
560
652
|
/*
|
|
561
653
|
* PropertySignature
|
|
562
654
|
*/
|
|
563
655
|
class PropertySignature {
|
|
656
|
+
name;
|
|
657
|
+
type;
|
|
658
|
+
isOptional;
|
|
659
|
+
isReadonly;
|
|
660
|
+
annotations;
|
|
564
661
|
constructor(name, type, isOptional, isReadonly, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
565
662
|
this.name = name;
|
|
566
663
|
this.type = type;
|
|
@@ -571,6 +668,9 @@ class PropertySignature {
|
|
|
571
668
|
clone(newProperties) {
|
|
572
669
|
return new PropertySignature(newProperties.name ?? this.name, newProperties.type ?? this.type, newProperties.isOptional ?? this.isOptional, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
|
|
573
670
|
}
|
|
671
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
672
|
+
return that instanceof PropertySignature && context.comparator(this.name, that.name) && context.comparator(this.type, that.type) && context.comparator(this.isOptional, that.isOptional) && context.comparator(this.isReadonly, that.isReadonly) && context.comparator(this.annotations, that.annotations);
|
|
673
|
+
}
|
|
574
674
|
}
|
|
575
675
|
/**
|
|
576
676
|
* @tsplus static fncts.schema.ASTOps createPropertySignature
|
|
@@ -583,11 +683,17 @@ function createPropertySignature_1(name, type, isOptional, isReadonly, annotatio
|
|
|
583
683
|
* IndexSignature
|
|
584
684
|
*/
|
|
585
685
|
class IndexSignature {
|
|
686
|
+
parameter;
|
|
687
|
+
type;
|
|
688
|
+
isReadonly;
|
|
586
689
|
constructor(parameter, type, isReadonly) {
|
|
587
690
|
this.parameter = parameter;
|
|
588
691
|
this.type = type;
|
|
589
692
|
this.isReadonly = isReadonly;
|
|
590
693
|
}
|
|
694
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
695
|
+
return that instanceof IndexSignature && context.comparator(this.parameter, that.parameter) && context.comparator(this.type, that.type) && context.comparator(this.isReadonly, that.isReadonly);
|
|
696
|
+
}
|
|
591
697
|
}
|
|
592
698
|
/**
|
|
593
699
|
* @tsplus static fncts.schema.ASTOps createIndexSignature
|
|
@@ -600,16 +706,22 @@ function createIndexSignature_1(parameter, type, isReadonly) {
|
|
|
600
706
|
* TypeLiteral
|
|
601
707
|
*/
|
|
602
708
|
class TypeLiteral extends AST {
|
|
709
|
+
annotations;
|
|
710
|
+
_tag = 17 /* ASTTag.TypeLiteral */;
|
|
711
|
+
propertySignatures;
|
|
712
|
+
indexSignatures;
|
|
603
713
|
constructor(propertySignatures, indexSignatures, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
604
714
|
super();
|
|
605
715
|
this.annotations = annotations;
|
|
606
|
-
this._tag = 17 /* ASTTag.TypeLiteral */;
|
|
607
716
|
this.propertySignatures = sortByAscendingCardinality(propertySignatures);
|
|
608
717
|
this.indexSignatures = sortByAscendingCardinality(indexSignatures);
|
|
609
718
|
}
|
|
610
719
|
clone(newProperties) {
|
|
611
720
|
return new TypeLiteral(newProperties.propertySignatures ?? this.propertySignatures, newProperties.indexSignatures ?? this.indexSignatures, newProperties.annotations ?? this.annotations);
|
|
612
721
|
}
|
|
722
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
723
|
+
return hasTag(that, 17 /* ASTTag.TypeLiteral */) && context.comparator(this.propertySignatures, that.propertySignatures) && context.comparator(this.indexSignatures, that.indexSignatures) && context.comparator(this.annotations, that.annotations);
|
|
724
|
+
}
|
|
613
725
|
}
|
|
614
726
|
/**
|
|
615
727
|
* @tsplus static fncts.schema.ASTOps isTypeLiteral
|
|
@@ -629,20 +741,25 @@ function createTypeLiteral_1(propertySignatures, indexSignatures, annotations) {
|
|
|
629
741
|
/**
|
|
630
742
|
* @tsplus static fncts.schema.ASTOps unknownRecord
|
|
631
743
|
*/
|
|
632
|
-
const unknownRecord = exports.unknownRecord = /*#__PURE__*/createTypeLiteral_1(/*#__PURE__*/
|
|
744
|
+
const unknownRecord = exports.unknownRecord = /*#__PURE__*/createTypeLiteral_1(/*#__PURE__*/tsplus_module_6.empty(), /*#__PURE__*/tsplus_module_6.vector(/*#__PURE__*/createIndexSignature_1(stringKeyword_1, unknownKeyword_1, true), /*#__PURE__*/createIndexSignature_1(symbolKeyword_1, unknownKeyword_1, true)));
|
|
633
745
|
/*
|
|
634
746
|
* Union
|
|
635
747
|
*/
|
|
636
748
|
class Union extends AST {
|
|
749
|
+
types;
|
|
750
|
+
annotations;
|
|
751
|
+
_tag = 18 /* ASTTag.Union */;
|
|
637
752
|
constructor(types, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
638
753
|
super();
|
|
639
754
|
this.types = types;
|
|
640
755
|
this.annotations = annotations;
|
|
641
|
-
this._tag = 18 /* ASTTag.Union */;
|
|
642
756
|
}
|
|
643
757
|
clone(newProperties) {
|
|
644
758
|
return createUnion_1(newProperties.types ?? this.types, newProperties.annotations ?? this.annotations);
|
|
645
759
|
}
|
|
760
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
761
|
+
return hasTag(that, 18 /* ASTTag.Union */) && context.comparator(this.types, that.types) && context.comparator(this.annotations, that.annotations);
|
|
762
|
+
}
|
|
646
763
|
}
|
|
647
764
|
/**
|
|
648
765
|
* @tsplus fluent fncts.schema.AST isUnion
|
|
@@ -661,7 +778,7 @@ function createUnion_1(candidates, annotations = _ASTAnnotationMap.ASTAnnotation
|
|
|
661
778
|
case 0:
|
|
662
779
|
return neverKeyword_1;
|
|
663
780
|
case 1:
|
|
664
|
-
return
|
|
781
|
+
return tsplus_module_6.unsafeGet(0)(types);
|
|
665
782
|
default:
|
|
666
783
|
return new Union(sortByDescendingWeight(types), annotations);
|
|
667
784
|
}
|
|
@@ -670,15 +787,20 @@ function createUnion_1(candidates, annotations = _ASTAnnotationMap.ASTAnnotation
|
|
|
670
787
|
* Lazy
|
|
671
788
|
*/
|
|
672
789
|
class Lazy extends AST {
|
|
790
|
+
getAST;
|
|
791
|
+
annotations;
|
|
792
|
+
_tag = 19 /* ASTTag.Lazy */;
|
|
673
793
|
constructor(getAST, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
674
794
|
super();
|
|
675
795
|
this.getAST = getAST;
|
|
676
796
|
this.annotations = annotations;
|
|
677
|
-
this._tag = 19 /* ASTTag.Lazy */;
|
|
678
797
|
}
|
|
679
798
|
clone(newProperties) {
|
|
680
799
|
return new Lazy(newProperties.getAST ?? this.getAST, newProperties.annotations ?? this.annotations);
|
|
681
800
|
}
|
|
801
|
+
[tsplus_module_1.equalsSymbol](that) {
|
|
802
|
+
return this === that;
|
|
803
|
+
}
|
|
682
804
|
}
|
|
683
805
|
/**
|
|
684
806
|
* @tsplus static fncts.schema.ASTOps createLazy
|
|
@@ -698,19 +820,25 @@ function isLazy(self) {
|
|
|
698
820
|
* Refinement
|
|
699
821
|
*/
|
|
700
822
|
class Refinement extends AST {
|
|
823
|
+
from;
|
|
824
|
+
predicate;
|
|
825
|
+
annotations;
|
|
826
|
+
_tag = 20 /* ASTTag.Refinement */;
|
|
701
827
|
constructor(from, predicate, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
702
828
|
super();
|
|
703
829
|
this.from = from;
|
|
704
830
|
this.predicate = predicate;
|
|
705
831
|
this.annotations = annotations;
|
|
706
|
-
this._tag = 20 /* ASTTag.Refinement */;
|
|
707
832
|
}
|
|
708
833
|
decode(input, options) {
|
|
709
|
-
return this.predicate(input) ?
|
|
834
|
+
return this.predicate(input) ? tsplus_module_8.succeed(input) : tsplus_module_8.fail(tsplus_module_9.typeError(this, input));
|
|
710
835
|
}
|
|
711
836
|
clone(newProperties) {
|
|
712
837
|
return new Refinement(newProperties.from ?? this.from, newProperties.predicate ?? this.predicate, newProperties.annotations ?? this.annotations);
|
|
713
838
|
}
|
|
839
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
840
|
+
return hasTag(that, 20 /* ASTTag.Refinement */) && context.comparator(this.from, that.from) && context.comparator(this.predicate, that.predicate) && context.comparator(this.annotations, that.annotations);
|
|
841
|
+
}
|
|
714
842
|
}
|
|
715
843
|
/**
|
|
716
844
|
* @tsplus static fncts.schema.ASTOps createRefinement
|
|
@@ -727,6 +855,12 @@ function isRefinement(self) {
|
|
|
727
855
|
* Transform
|
|
728
856
|
*/
|
|
729
857
|
class Transform extends AST {
|
|
858
|
+
from;
|
|
859
|
+
to;
|
|
860
|
+
decode;
|
|
861
|
+
encode;
|
|
862
|
+
annotations;
|
|
863
|
+
_tag = 21 /* ASTTag.Transform */;
|
|
730
864
|
constructor(from, to, decode, encode, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
731
865
|
super();
|
|
732
866
|
this.from = from;
|
|
@@ -734,11 +868,13 @@ class Transform extends AST {
|
|
|
734
868
|
this.decode = decode;
|
|
735
869
|
this.encode = encode;
|
|
736
870
|
this.annotations = annotations;
|
|
737
|
-
this._tag = 21 /* ASTTag.Transform */;
|
|
738
871
|
}
|
|
739
872
|
clone(newProperties) {
|
|
740
873
|
return new Transform(newProperties.from ?? this.from, newProperties.to ?? this.to, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
|
|
741
874
|
}
|
|
875
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
876
|
+
return hasTag(that, 21 /* ASTTag.Transform */) && context.comparator(this.from, that.from) && context.comparator(this.to, that.to) && context.comparator(this.decode, that.decode) && context.comparator(this.encode, that.encode) && context.comparator(this.annotations, that.annotations);
|
|
877
|
+
}
|
|
742
878
|
}
|
|
743
879
|
/**
|
|
744
880
|
* @tsplus static fncts.schema.ASTOps createTransform
|
|
@@ -751,16 +887,22 @@ function createTransform(from, to, decode, encode, annotations) {
|
|
|
751
887
|
* Validation
|
|
752
888
|
*/
|
|
753
889
|
class Validation extends AST {
|
|
890
|
+
from;
|
|
891
|
+
validation;
|
|
892
|
+
annotations;
|
|
893
|
+
_tag = 22 /* ASTTag.Validation */;
|
|
754
894
|
constructor(from, validation, annotations = _ASTAnnotationMap.ASTAnnotationMap.empty) {
|
|
755
895
|
super();
|
|
756
896
|
this.from = from;
|
|
757
897
|
this.validation = validation;
|
|
758
898
|
this.annotations = annotations;
|
|
759
|
-
this._tag = 22 /* ASTTag.Validation */;
|
|
760
899
|
}
|
|
761
900
|
clone(newProperties) {
|
|
762
901
|
return new Validation(newProperties.from ?? this.from, newProperties.validation ?? this.validation, newProperties.annotations ?? this.annotations);
|
|
763
902
|
}
|
|
903
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
904
|
+
return hasTag(that, 22 /* ASTTag.Validation */) && context.comparator(this.from, that.from) && context.comparator(this.validation, that.validation) && context.comparator(this.annotations, that.annotations);
|
|
905
|
+
}
|
|
764
906
|
}
|
|
765
907
|
/**
|
|
766
908
|
* @tsplus static fncts.schema.ASTOps createValidation
|
|
@@ -811,26 +953,26 @@ function getCardinality(ast) {
|
|
|
811
953
|
}
|
|
812
954
|
}
|
|
813
955
|
function sortByAscendingCardinality(types) {
|
|
814
|
-
return
|
|
956
|
+
return tsplus_module_6.sort(tsplus_module_11.contramap(({
|
|
815
957
|
type
|
|
816
|
-
}) => getCardinality(type))(
|
|
958
|
+
}) => getCardinality(type))(tsplus_module_10.Ord))(types);
|
|
817
959
|
}
|
|
818
|
-
const OrdWeight = /*#__PURE__*/
|
|
819
|
-
const maxWeight = /*#__PURE__*/
|
|
960
|
+
const OrdWeight = /*#__PURE__*/tsplus_module_12.tuple(tsplus_module_10.Ord, tsplus_module_10.Ord, tsplus_module_10.Ord);
|
|
961
|
+
const maxWeight = /*#__PURE__*/tsplus_module_13.max(OrdWeight);
|
|
820
962
|
function maxWeightAll(weights) {
|
|
821
|
-
return
|
|
963
|
+
return tsplus_module_14.foldLeft(emptyWeight, (b, a) => maxWeight(b)(a))(weights);
|
|
822
964
|
}
|
|
823
965
|
const emptyWeight = [0, 0, 0];
|
|
824
966
|
function getWeight(ast) {
|
|
825
967
|
void 0;
|
|
826
968
|
switch (ast._tag) {
|
|
827
969
|
case 0 /* ASTTag.Declaration */:
|
|
828
|
-
return
|
|
970
|
+
return tsplus_module_15.match(() => [6, 0, 0], ast => {
|
|
829
971
|
const [_, y, z] = getWeight(ast);
|
|
830
972
|
return [6, y, z];
|
|
831
|
-
})(ast.annotations.get(
|
|
973
|
+
})(ast.annotations.get(tsplus_module_4.Surrogate));
|
|
832
974
|
case 16 /* ASTTag.Tuple */:
|
|
833
|
-
return [2, ast.elements.length,
|
|
975
|
+
return [2, ast.elements.length, tsplus_module_15.match(() => 0, rest => rest.length)(ast.rest)];
|
|
834
976
|
case 17 /* ASTTag.TypeLiteral */:
|
|
835
977
|
{
|
|
836
978
|
const y = ast.propertySignatures.length;
|
|
@@ -838,7 +980,7 @@ function getWeight(ast) {
|
|
|
838
980
|
return y + z === 0 ? [-4, 0, 0] : [4, y, z];
|
|
839
981
|
}
|
|
840
982
|
case 18 /* ASTTag.Union */:
|
|
841
|
-
return maxWeightAll(
|
|
983
|
+
return maxWeightAll(tsplus_module_6.map(getWeight)(ast.types));
|
|
842
984
|
case 19 /* ASTTag.Lazy */:
|
|
843
985
|
return [8, 0, 0];
|
|
844
986
|
case 20 /* ASTTag.Refinement */:
|
|
@@ -856,28 +998,28 @@ function getWeight(ast) {
|
|
|
856
998
|
}
|
|
857
999
|
}
|
|
858
1000
|
function sortByDescendingWeight(types) {
|
|
859
|
-
return
|
|
1001
|
+
return tsplus_module_6.sort(tsplus_module_11.contramap(getWeight)(OrdWeight))(types);
|
|
860
1002
|
}
|
|
861
1003
|
function unify(candidates) {
|
|
862
|
-
let out =
|
|
1004
|
+
let out = tsplus_module_6.flatMap(ast => {
|
|
863
1005
|
void 0;
|
|
864
1006
|
switch (ast._tag) {
|
|
865
1007
|
case 5 /* ASTTag.NeverKeyword */:
|
|
866
|
-
return
|
|
1008
|
+
return tsplus_module_6.empty();
|
|
867
1009
|
case 18 /* ASTTag.Union */:
|
|
868
1010
|
return ast.types;
|
|
869
1011
|
default:
|
|
870
|
-
return
|
|
1012
|
+
return tsplus_module_6.vector(ast);
|
|
871
1013
|
}
|
|
872
1014
|
})(candidates);
|
|
873
|
-
if (
|
|
874
|
-
out =
|
|
1015
|
+
if (tsplus_module_6.some(isStringKeyword_1)(out)) {
|
|
1016
|
+
out = tsplus_module_6.filter(m => !(isLiteral_1(m) && typeof m.literal === "string"))(out);
|
|
875
1017
|
}
|
|
876
|
-
if (
|
|
877
|
-
out =
|
|
1018
|
+
if (tsplus_module_6.some(isNumberKeyword_1)(out)) {
|
|
1019
|
+
out = tsplus_module_6.filter(m => !(isLiteral_1(m) && typeof m.literal === "number"))(out);
|
|
878
1020
|
}
|
|
879
|
-
if (
|
|
880
|
-
out =
|
|
1021
|
+
if (tsplus_module_6.some(isSymbolKeyword_1)(out)) {
|
|
1022
|
+
out = tsplus_module_6.filter(m => !isUniqueSymbol_1(m))(out);
|
|
881
1023
|
}
|
|
882
1024
|
return out;
|
|
883
1025
|
}
|
|
@@ -906,10 +1048,10 @@ function setAnnotation(annotation, value) {
|
|
|
906
1048
|
*/
|
|
907
1049
|
function appendRestElement(restElement) {
|
|
908
1050
|
return self => {
|
|
909
|
-
if (
|
|
1051
|
+
if (tsplus_module_16.isJust(self.rest)) {
|
|
910
1052
|
throw new Error("A rest element cannot follow another rest element. ts(1265)");
|
|
911
1053
|
}
|
|
912
|
-
return createTuple_1(self.elements,
|
|
1054
|
+
return createTuple_1(self.elements, tsplus_module_7.just(tsplus_module_6.vector(restElement), fileName_1 + ":1313:43"), self.isReadonly, self.annotations);
|
|
913
1055
|
};
|
|
914
1056
|
}
|
|
915
1057
|
/**
|
|
@@ -917,14 +1059,14 @@ function appendRestElement(restElement) {
|
|
|
917
1059
|
*/
|
|
918
1060
|
function appendElement(element) {
|
|
919
1061
|
return self => {
|
|
920
|
-
if (
|
|
1062
|
+
if (tsplus_module_6.some(e => e.isOptional)(self.elements) && !element.isOptional) {
|
|
921
1063
|
throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
922
1064
|
}
|
|
923
|
-
return
|
|
1065
|
+
return tsplus_module_15.match(() => createTuple_1(tsplus_module_6.append(element)(self.elements), tsplus_module_7.nothing(fileName_1 + ":1326:63"), self.isReadonly, self.annotations), rest => {
|
|
924
1066
|
if (element.isOptional) {
|
|
925
1067
|
throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
926
1068
|
}
|
|
927
|
-
return createTuple_1(self.elements,
|
|
1069
|
+
return createTuple_1(self.elements, tsplus_module_7.just(tsplus_module_6.append(element.type)(rest), fileName_1 + ":1331:47"), self.isReadonly, self.annotations);
|
|
928
1070
|
})(self.rest);
|
|
929
1071
|
};
|
|
930
1072
|
}
|
|
@@ -938,21 +1080,21 @@ function getPropertySignatures_1(self) {
|
|
|
938
1080
|
void 0;
|
|
939
1081
|
switch (self._tag) {
|
|
940
1082
|
case 0 /* ASTTag.Declaration */:
|
|
941
|
-
return
|
|
1083
|
+
return tsplus_module_15.match(() => tsplus_module_6.empty(), surrogate => getPropertySignatures_1(surrogate))(self.annotations.get(tsplus_module_4.Surrogate));
|
|
942
1084
|
case 16 /* ASTTag.Tuple */:
|
|
943
|
-
return
|
|
1085
|
+
return tsplus_module_6.mapWithIndex((i, element) => createPropertySignature_1(i, element.type, element.isOptional, self.isReadonly))(self.elements);
|
|
944
1086
|
case 18 /* ASTTag.Union */:
|
|
945
1087
|
{
|
|
946
|
-
const propertySignatures =
|
|
947
|
-
return
|
|
1088
|
+
const propertySignatures = tsplus_module_6.map(getPropertySignatures_1)(self.types);
|
|
1089
|
+
return tsplus_module_6.filterMap(({
|
|
948
1090
|
name
|
|
949
1091
|
}) => {
|
|
950
|
-
if (
|
|
951
|
-
const members =
|
|
952
|
-
return
|
|
1092
|
+
if (tsplus_module_6.every(ps => tsplus_module_6.some(p => p.name === name)(ps))(propertySignatures)) {
|
|
1093
|
+
const members = tsplus_module_6.flatMap(ps => tsplus_module_6.filter(p => p.name === name)(ps))(propertySignatures);
|
|
1094
|
+
return tsplus_module_7.just(createPropertySignature_1(name, createUnion_1(tsplus_module_6.map(p => p.type)(members)), tsplus_module_6.some(p => p.isOptional)(members), tsplus_module_6.some(p => p.isReadonly)(members)), fileName_1 + ":1363:22");
|
|
953
1095
|
}
|
|
954
|
-
return
|
|
955
|
-
})(
|
|
1096
|
+
return tsplus_module_7.nothing(fileName_1 + ":1372:23");
|
|
1097
|
+
})(tsplus_module_6.unsafeGet(0)(propertySignatures));
|
|
956
1098
|
}
|
|
957
1099
|
case 17 /* ASTTag.TypeLiteral */:
|
|
958
1100
|
return self.propertySignatures;
|
|
@@ -963,7 +1105,7 @@ function getPropertySignatures_1(self) {
|
|
|
963
1105
|
case 21 /* ASTTag.Transform */:
|
|
964
1106
|
return getPropertySignatures_1(self.to);
|
|
965
1107
|
default:
|
|
966
|
-
return
|
|
1108
|
+
return tsplus_module_6.empty();
|
|
967
1109
|
}
|
|
968
1110
|
}
|
|
969
1111
|
/**
|
|
@@ -973,16 +1115,16 @@ function keysOf_1(ast) {
|
|
|
973
1115
|
void 0;
|
|
974
1116
|
switch (ast._tag) {
|
|
975
1117
|
case 0 /* ASTTag.Declaration */:
|
|
976
|
-
return
|
|
1118
|
+
return tsplus_module_15.match(() => tsplus_module_6.empty(), surrogate => keysOf_1(surrogate))(ast.annotations.get(tsplus_module_4.Surrogate));
|
|
977
1119
|
case 5 /* ASTTag.NeverKeyword */:
|
|
978
1120
|
case 7 /* ASTTag.AnyKeyword */:
|
|
979
|
-
return
|
|
1121
|
+
return tsplus_module_6.vector(stringKeyword_1, numberKeyword_1, symbolKeyword_1);
|
|
980
1122
|
case 8 /* ASTTag.StringKeyword */:
|
|
981
|
-
return
|
|
1123
|
+
return tsplus_module_6.vector(createLiteral_1("length"));
|
|
982
1124
|
case 17 /* ASTTag.TypeLiteral */:
|
|
983
|
-
return
|
|
1125
|
+
return tsplus_module_6.concat(tsplus_module_6.map(is => getParameter(is.parameter))(ast.indexSignatures))(tsplus_module_6.map(p => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(ast.propertySignatures));
|
|
984
1126
|
case 18 /* ASTTag.Union */:
|
|
985
|
-
return
|
|
1127
|
+
return tsplus_module_6.map(p => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(getPropertySignatures_1(ast));
|
|
986
1128
|
case 19 /* ASTTag.Lazy */:
|
|
987
1129
|
return keysOf_1(ast.getAST());
|
|
988
1130
|
case 20 /* ASTTag.Refinement */:
|
|
@@ -990,7 +1132,7 @@ function keysOf_1(ast) {
|
|
|
990
1132
|
case 21 /* ASTTag.Transform */:
|
|
991
1133
|
return keysOf_1(ast.to);
|
|
992
1134
|
default:
|
|
993
|
-
return
|
|
1135
|
+
return tsplus_module_6.empty();
|
|
994
1136
|
}
|
|
995
1137
|
}
|
|
996
1138
|
/**
|
|
@@ -1003,8 +1145,8 @@ function keyof(self) {
|
|
|
1003
1145
|
* @tsplus static fncts.schema.ASTOps createRecord
|
|
1004
1146
|
*/
|
|
1005
1147
|
function createRecord(key, value, isReadonly) {
|
|
1006
|
-
const propertySignatures =
|
|
1007
|
-
const indexSignatures =
|
|
1148
|
+
const propertySignatures = tsplus_module_6.emptyPushable();
|
|
1149
|
+
const indexSignatures = tsplus_module_6.emptyPushable();
|
|
1008
1150
|
function go(key) {
|
|
1009
1151
|
void 0;
|
|
1010
1152
|
switch (key._tag) {
|
|
@@ -1014,18 +1156,18 @@ function createRecord(key, value, isReadonly) {
|
|
|
1014
1156
|
case 12 /* ASTTag.SymbolKeyword */:
|
|
1015
1157
|
case 15 /* ASTTag.TemplateLiteral */:
|
|
1016
1158
|
case 20 /* ASTTag.Refinement */:
|
|
1017
|
-
|
|
1159
|
+
tsplus_module_17.push(createIndexSignature_1(key, value, isReadonly))(indexSignatures);
|
|
1018
1160
|
break;
|
|
1019
1161
|
case 1 /* ASTTag.Literal */:
|
|
1020
1162
|
if (typeof key.literal === "string" || typeof key.literal === "number") {
|
|
1021
|
-
|
|
1163
|
+
tsplus_module_17.push(createPropertySignature_1(key.literal, value, false, isReadonly))(propertySignatures);
|
|
1022
1164
|
}
|
|
1023
1165
|
break;
|
|
1024
1166
|
case 2 /* ASTTag.UniqueSymbol */:
|
|
1025
|
-
|
|
1167
|
+
tsplus_module_17.push(createPropertySignature_1(key.symbol, value, false, isReadonly))(propertySignatures);
|
|
1026
1168
|
break;
|
|
1027
1169
|
case 18 /* ASTTag.Union */:
|
|
1028
|
-
|
|
1170
|
+
tsplus_module_6.forEach(go)(key.types);
|
|
1029
1171
|
break;
|
|
1030
1172
|
default:
|
|
1031
1173
|
throw new Error(`createRecord: Unsupported key\n${(0, _Showable.show)(key)}`);
|
|
@@ -1039,7 +1181,7 @@ function createRecord(key, value, isReadonly) {
|
|
|
1039
1181
|
*/
|
|
1040
1182
|
function pick(keys) {
|
|
1041
1183
|
return self => {
|
|
1042
|
-
return createTypeLiteral_1(
|
|
1184
|
+
return createTypeLiteral_1(tsplus_module_6.filter(ps => tsplus_module_6.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_6.empty());
|
|
1043
1185
|
};
|
|
1044
1186
|
}
|
|
1045
1187
|
/**
|
|
@@ -1047,7 +1189,7 @@ function pick(keys) {
|
|
|
1047
1189
|
*/
|
|
1048
1190
|
function omit(keys) {
|
|
1049
1191
|
return self => {
|
|
1050
|
-
return createTypeLiteral_1(
|
|
1192
|
+
return createTypeLiteral_1(tsplus_module_6.filter(ps => !tsplus_module_6.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_6.empty());
|
|
1051
1193
|
};
|
|
1052
1194
|
}
|
|
1053
1195
|
/**
|
|
@@ -1057,11 +1199,11 @@ function partial_1(self) {
|
|
|
1057
1199
|
void 0;
|
|
1058
1200
|
switch (self._tag) {
|
|
1059
1201
|
case 16 /* ASTTag.Tuple */:
|
|
1060
|
-
return createTuple_1(
|
|
1202
|
+
return createTuple_1(tsplus_module_6.map(e => createElement_1(e.type, true))(self.elements), tsplus_module_18.map(rest => tsplus_module_6.vector(createUnion_1(tsplus_module_6.append(undefinedKeyword_1)(rest))))(self.rest), self.isReadonly);
|
|
1061
1203
|
case 17 /* ASTTag.TypeLiteral */:
|
|
1062
|
-
return createTypeLiteral_1(
|
|
1204
|
+
return createTypeLiteral_1(tsplus_module_6.map(f => createPropertySignature_1(f.name, f.type, true, f.isReadonly, f.annotations))(self.propertySignatures), self.indexSignatures);
|
|
1063
1205
|
case 18 /* ASTTag.Union */:
|
|
1064
|
-
return createUnion_1(
|
|
1206
|
+
return createUnion_1(tsplus_module_6.map(partial_1)(self.types));
|
|
1065
1207
|
case 19 /* ASTTag.Lazy */:
|
|
1066
1208
|
return createLazy_1(() => partial_1(self.getAST()));
|
|
1067
1209
|
case 20 /* ASTTag.Refinement */:
|
|
@@ -1086,18 +1228,18 @@ function getFrom_1(ast) {
|
|
|
1086
1228
|
switch (ast._tag) {
|
|
1087
1229
|
case 0 /* ASTTag.Declaration */:
|
|
1088
1230
|
{
|
|
1089
|
-
const surrogate = ast.annotations.get(
|
|
1090
|
-
if (
|
|
1231
|
+
const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
|
|
1232
|
+
if (tsplus_module_16.isJust(surrogate)) {
|
|
1091
1233
|
return getFrom_1(surrogate.value);
|
|
1092
1234
|
}
|
|
1093
1235
|
break;
|
|
1094
1236
|
}
|
|
1095
1237
|
case 16 /* ASTTag.Tuple */:
|
|
1096
|
-
return createTuple_1(
|
|
1238
|
+
return createTuple_1(tsplus_module_6.map(element => createElement_1(getFrom_1(element.type), element.isOptional))(ast.elements), tsplus_module_18.map(restElement => tsplus_module_6.map(getFrom_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
|
|
1097
1239
|
case 17 /* ASTTag.TypeLiteral */:
|
|
1098
|
-
return createTypeLiteral_1(
|
|
1240
|
+
return createTypeLiteral_1(tsplus_module_6.map(ps => createPropertySignature_1(ps.name, getFrom_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_6.map(is => createIndexSignature_1(is.parameter, getFrom_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
|
|
1099
1241
|
case 18 /* ASTTag.Union */:
|
|
1100
|
-
return createUnion_1(
|
|
1242
|
+
return createUnion_1(tsplus_module_6.map(getFrom_1)(ast.types), ast.annotations);
|
|
1101
1243
|
case 19 /* ASTTag.Lazy */:
|
|
1102
1244
|
return createLazy_1(() => getFrom_1(ast.getAST()), ast.annotations);
|
|
1103
1245
|
case 20 /* ASTTag.Refinement */:
|
|
@@ -1114,18 +1256,18 @@ function getTo_1(ast) {
|
|
|
1114
1256
|
switch (ast._tag) {
|
|
1115
1257
|
case 0 /* ASTTag.Declaration */:
|
|
1116
1258
|
{
|
|
1117
|
-
const surrogate = ast.annotations.get(
|
|
1118
|
-
if (
|
|
1259
|
+
const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
|
|
1260
|
+
if (tsplus_module_16.isJust(surrogate)) {
|
|
1119
1261
|
return getTo_1(surrogate.value);
|
|
1120
1262
|
}
|
|
1121
1263
|
break;
|
|
1122
1264
|
}
|
|
1123
1265
|
case 16 /* ASTTag.Tuple */:
|
|
1124
|
-
return createTuple_1(
|
|
1266
|
+
return createTuple_1(tsplus_module_6.map(element => createElement_1(getTo_1(element.type), element.isOptional))(ast.elements), tsplus_module_18.map(restElement => tsplus_module_6.map(getTo_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
|
|
1125
1267
|
case 17 /* ASTTag.TypeLiteral */:
|
|
1126
|
-
return createTypeLiteral_1(
|
|
1268
|
+
return createTypeLiteral_1(tsplus_module_6.map(ps => createPropertySignature_1(ps.name, getTo_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_6.map(is => createIndexSignature_1(is.parameter, getTo_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
|
|
1127
1269
|
case 18 /* ASTTag.Union */:
|
|
1128
|
-
return createUnion_1(
|
|
1270
|
+
return createUnion_1(tsplus_module_6.map(getTo_1)(ast.types), ast.annotations);
|
|
1129
1271
|
case 19 /* ASTTag.Lazy */:
|
|
1130
1272
|
return createLazy_1(() => getTo_1(ast.getAST()), ast.annotations);
|
|
1131
1273
|
case 20 /* ASTTag.Refinement */:
|
|
@@ -1150,8 +1292,8 @@ function getLiterals(ast, isDecoding) {
|
|
|
1150
1292
|
switch (ast._tag) {
|
|
1151
1293
|
case 0 /* ASTTag.Declaration */:
|
|
1152
1294
|
{
|
|
1153
|
-
const surrogate = ast.annotations.get(
|
|
1154
|
-
if (
|
|
1295
|
+
const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
|
|
1296
|
+
if (tsplus_module_16.isJust(surrogate)) {
|
|
1155
1297
|
return getLiterals(surrogate.value, isDecoding);
|
|
1156
1298
|
}
|
|
1157
1299
|
break;
|
|
@@ -1160,7 +1302,7 @@ function getLiterals(ast, isDecoding) {
|
|
|
1160
1302
|
{
|
|
1161
1303
|
const out = [];
|
|
1162
1304
|
for (let i = 0; i < ast.propertySignatures.length; i++) {
|
|
1163
|
-
const propertySignature =
|
|
1305
|
+
const propertySignature = tsplus_module_6.unsafeGet(i)(ast.propertySignatures);
|
|
1164
1306
|
if (isLiteral_1(propertySignature.type) && !propertySignature.isOptional) {
|
|
1165
1307
|
out.push([propertySignature.name, propertySignature.type]);
|
|
1166
1308
|
}
|
|
@@ -1178,28 +1320,28 @@ function getSearchTree(members, isDecoding) {
|
|
|
1178
1320
|
const keys = {};
|
|
1179
1321
|
const otherwise = [];
|
|
1180
1322
|
for (let i = 0; i < members.length; i++) {
|
|
1181
|
-
const member =
|
|
1323
|
+
const member = tsplus_module_6.unsafeGet(i)(members);
|
|
1182
1324
|
const tags = getLiterals(member, isDecoding);
|
|
1183
1325
|
if (tags.length > 0) {
|
|
1184
1326
|
for (let j = 0; j < tags.length; j++) {
|
|
1185
1327
|
const [key, literal] = tags[j];
|
|
1186
1328
|
const hash = String(literal.literal);
|
|
1187
|
-
keys[key]
|
|
1329
|
+
keys[key] ||= {
|
|
1188
1330
|
buckets: {},
|
|
1189
1331
|
ast: neverKeyword_1,
|
|
1190
1332
|
literals: []
|
|
1191
|
-
}
|
|
1333
|
+
};
|
|
1192
1334
|
const buckets = keys[key].buckets;
|
|
1193
1335
|
if (Object.prototype.hasOwnProperty.call(buckets, hash)) {
|
|
1194
1336
|
if (j < tags.length - 1) {
|
|
1195
1337
|
continue;
|
|
1196
1338
|
}
|
|
1197
1339
|
buckets[hash].push(member);
|
|
1198
|
-
keys[key].ast = createUnion_1(
|
|
1340
|
+
keys[key].ast = createUnion_1(tsplus_module_6.vector(keys[key].ast, literal));
|
|
1199
1341
|
keys[key].literals.push(literal);
|
|
1200
1342
|
} else {
|
|
1201
1343
|
buckets[hash] = [member];
|
|
1202
|
-
keys[key].ast = createUnion_1(
|
|
1344
|
+
keys[key].ast = createUnion_1(tsplus_module_6.vector(keys[key].ast, literal));
|
|
1203
1345
|
keys[key].literals.push(literal);
|
|
1204
1346
|
break;
|
|
1205
1347
|
}
|
|
@@ -1219,10 +1361,10 @@ function getSearchTree(members, isDecoding) {
|
|
|
1219
1361
|
function getFormattedExpected(verbose = false) {
|
|
1220
1362
|
return self => {
|
|
1221
1363
|
if (verbose) {
|
|
1222
|
-
const description =
|
|
1223
|
-
return
|
|
1364
|
+
const description = tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Title))(self.annotations.get(tsplus_module_4.Description));
|
|
1365
|
+
return tsplus_module_15.match(() => description, identifier => tsplus_module_15.match(() => tsplus_module_7.just(identifier, fileName_1 + ":1710:23"), description => tsplus_module_7.just(`${identifier} (${description})`, fileName_1 + ":1711:34"))(description))(self.annotations.get(tsplus_module_4.Identifier));
|
|
1224
1366
|
} else {
|
|
1225
|
-
return
|
|
1367
|
+
return tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Description))(tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Title))(self.annotations.get(tsplus_module_4.Identifier)));
|
|
1226
1368
|
}
|
|
1227
1369
|
};
|
|
1228
1370
|
}
|