@fncts/schema 0.0.24 → 0.0.25

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