@keetanetwork/anchor 0.0.24 → 0.0.26

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 (32) hide show
  1. package/lib/certificates.d.ts +23 -9
  2. package/lib/certificates.d.ts.map +1 -1
  3. package/lib/certificates.generated.js +16 -1
  4. package/lib/certificates.generated.js.map +1 -1
  5. package/lib/certificates.js +74 -157
  6. package/lib/certificates.js.map +1 -1
  7. package/lib/resolver.js +40 -40
  8. package/lib/utils/asn1.d.ts +13 -0
  9. package/lib/utils/asn1.d.ts.map +1 -1
  10. package/lib/utils/asn1.js +1973 -0
  11. package/lib/utils/asn1.js.map +1 -1
  12. package/lib/utils/external.d.ts.map +1 -1
  13. package/lib/utils/external.js +2 -9
  14. package/lib/utils/external.js.map +1 -1
  15. package/npm-shrinkwrap.json +2 -2
  16. package/package.json +1 -1
  17. package/services/asset-movement/common.d.ts +70 -46
  18. package/services/asset-movement/common.d.ts.map +1 -1
  19. package/services/asset-movement/common.js +1442 -708
  20. package/services/asset-movement/common.js.map +1 -1
  21. package/services/asset-movement/lib/location.d.ts +64 -0
  22. package/services/asset-movement/lib/location.d.ts.map +1 -0
  23. package/services/asset-movement/lib/location.generated.d.ts +4 -0
  24. package/services/asset-movement/lib/location.generated.d.ts.map +1 -0
  25. package/services/asset-movement/lib/location.generated.js +16 -0
  26. package/services/asset-movement/lib/location.generated.js.map +1 -0
  27. package/services/asset-movement/lib/location.js +155 -0
  28. package/services/asset-movement/lib/location.js.map +1 -0
  29. package/services/kyc/iso20022.generated.js +54 -54
  30. package/services/kyc/iso20022.generated.js.map +1 -1
  31. package/services/kyc/utils/generate-kyc-schema.js +6 -34
  32. package/services/kyc/utils/generate-kyc-schema.js.map +1 -1
package/lib/utils/asn1.js CHANGED
@@ -1,8 +1,1981 @@
1
+ import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
2
+ import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
1
3
  import { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
4
+ import { isReferenceSchema } from './asn1.generated.js';
5
+ import { EncryptedContainer } from '../encrypted-container.js';
6
+ import { Buffer, bufferToArrayBuffer } from './buffer.js';
7
+ import { checkHashWithOID } from './external.js';
8
+ const KeetaNetAccount = KeetaNetLib.Account;
9
+ import { assert, createAssert, createIs } from 'typia';
2
10
  const ASN1 = KeetaNetLib.Utils.ASN1;
3
11
  const ASN1toJS = ASN1.ASN1toJS;
4
12
  const JStoASN1 = ASN1.JStoASN1;
5
13
  const BufferStorageASN1 = ASN1.BufferStorageASN1;
6
14
  const ValidateASN1 = ASN1.ValidateASN1;
15
+ const ASN1CheckUtilities = ASN1.ASN1CheckUtilities;
16
+ const { isASN1ContextTag, isASN1Struct, isASN1String, isASN1Date, isASN1BitString, isASN1Set } = ASN1CheckUtilities;
17
+ const assertStructFieldSchemaMap = (() => { const _ip0 = input => {
18
+ const array = input;
19
+ const top = input[0];
20
+ if (0 === input.length)
21
+ return true;
22
+ const arrayPredicators = [
23
+ [
24
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
25
+ entire => entire.every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))
26
+ ],
27
+ [
28
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
29
+ entire => entire.every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))
30
+ ]
31
+ ];
32
+ const passed = arrayPredicators.filter(pred => pred[0](top));
33
+ if (1 === passed.length)
34
+ return passed[0][1](array);
35
+ else if (1 < passed.length)
36
+ for (const pred of passed)
37
+ if (array.every(value => true === pred[0](value)))
38
+ return pred[1](array);
39
+ return false;
40
+ }; const _ip1 = input => {
41
+ const array = input;
42
+ const top = input[0];
43
+ if (0 === input.length)
44
+ return true;
45
+ const arrayPredicators = [
46
+ [
47
+ top => "string" === typeof top,
48
+ entire => entire.every(elem => "string" === typeof elem)
49
+ ],
50
+ [
51
+ top => "string" === typeof top,
52
+ entire => entire.every(elem => "string" === typeof elem)
53
+ ]
54
+ ];
55
+ const passed = arrayPredicators.filter(pred => pred[0](top));
56
+ if (1 === passed.length)
57
+ return passed[0][1](array);
58
+ else if (1 < passed.length)
59
+ for (const pred of passed)
60
+ if (array.every(value => true === pred[0](value)))
61
+ return pred[1](array);
62
+ return false;
63
+ }; const _ap2 = (input, _path, _exceptionable = true) => {
64
+ const array = input;
65
+ const top = input[0];
66
+ if (0 === input.length)
67
+ return true;
68
+ const arrayPredicators = [
69
+ [
70
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
71
+ method: "createAssert",
72
+ path: _path,
73
+ expected: "readonly [Schema, ...Schema[]]",
74
+ value: top
75
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
76
+ entire => entire.every((elem, _index16) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
77
+ method: "createAssert",
78
+ path: _path + "[" + _index16 + "]",
79
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
80
+ value: elem
81
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
82
+ method: "createAssert",
83
+ path: _path + "[" + _index16 + "]",
84
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
85
+ value: elem
86
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index16 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
87
+ method: "createAssert",
88
+ path: _path + "[" + _index16 + "]",
89
+ expected: "readonly [Schema, ...Schema[]]",
90
+ value: elem
91
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index16 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
92
+ method: "createAssert",
93
+ path: _path + "[" + _index16 + "]",
94
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
95
+ value: elem
96
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
97
+ method: "createAssert",
98
+ path: _path + "[" + _index16 + "]",
99
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
100
+ value: elem
101
+ }, _errorFactory)))
102
+ ],
103
+ [
104
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
105
+ method: "createAssert",
106
+ path: _path,
107
+ expected: "readonly [Schema, ...Schema[]]",
108
+ value: top
109
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
110
+ entire => entire.every((elem, _index17) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
111
+ method: "createAssert",
112
+ path: _path + "[" + _index17 + "]",
113
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
114
+ value: elem
115
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
116
+ method: "createAssert",
117
+ path: _path + "[" + _index17 + "]",
118
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
119
+ value: elem
120
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index17 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
121
+ method: "createAssert",
122
+ path: _path + "[" + _index17 + "]",
123
+ expected: "readonly [Schema, ...Schema[]]",
124
+ value: elem
125
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index17 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
126
+ method: "createAssert",
127
+ path: _path + "[" + _index17 + "]",
128
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
129
+ value: elem
130
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
131
+ method: "createAssert",
132
+ path: _path + "[" + _index17 + "]",
133
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
134
+ value: elem
135
+ }, _errorFactory)))
136
+ ]
137
+ ];
138
+ const passed = arrayPredicators.filter(pred => pred[0](top));
139
+ if (1 === passed.length)
140
+ return passed[0][1](array);
141
+ else if (1 < passed.length)
142
+ for (const pred of passed)
143
+ if (array.every(value => true === pred[0](value)))
144
+ return pred[1](array);
145
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
146
+ method: "createAssert",
147
+ path: _path,
148
+ expected: "(ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>)",
149
+ value: input
150
+ }, _errorFactory);
151
+ }; const _ap3 = (input, _path, _exceptionable = true) => {
152
+ const array = input;
153
+ const top = input[0];
154
+ if (0 === input.length)
155
+ return true;
156
+ const arrayPredicators = [
157
+ [
158
+ top => "string" === typeof top,
159
+ entire => entire.every((elem, _index20) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
160
+ method: "createAssert",
161
+ path: _path + "[" + _index20 + "]",
162
+ expected: "string",
163
+ value: elem
164
+ }, _errorFactory))
165
+ ],
166
+ [
167
+ top => "string" === typeof top,
168
+ entire => entire.every((elem, _index21) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
169
+ method: "createAssert",
170
+ path: _path + "[" + _index21 + "]",
171
+ expected: "string",
172
+ value: elem
173
+ }, _errorFactory))
174
+ ]
175
+ ];
176
+ const passed = arrayPredicators.filter(pred => pred[0](top));
177
+ if (1 === passed.length)
178
+ return passed[0][1](array);
179
+ else if (1 < passed.length)
180
+ for (const pred of passed)
181
+ if (array.every(value => true === pred[0](value)))
182
+ return pred[1](array);
183
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
184
+ method: "createAssert",
185
+ path: _path,
186
+ expected: "(Array<string> | ReadonlyArray<string>)",
187
+ value: input
188
+ }, _errorFactory);
189
+ }; const _io0 = input => Object.keys(input).every(key => {
190
+ const value = input[key];
191
+ if (undefined === value)
192
+ return true;
193
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu1(value)));
194
+ }); const _io1 = input => Array.isArray(input.choice) && (_ip0(input.choice) || false); const _io2 = input => "object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu2(input.choice); const _io3 = input => Object.keys(input).every(key => {
195
+ const value = input[key];
196
+ if (undefined === value)
197
+ return true;
198
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
199
+ }); const _io4 = input => null !== input.sequenceOf && undefined !== input.sequenceOf && ("function" === typeof input.sequenceOf || "bigint" === typeof input.sequenceOf || (Array.isArray(input.sequenceOf) && (_it0(input.sequenceOf) || false) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _iu0(input.sequenceOf))); const _io5 = input => null !== input.optional && undefined !== input.optional && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_it0(input.optional) || false) || "object" === typeof input.optional && null !== input.optional && _iu0(input.optional))); const _io6 = input => "context" === input.type && ("implicit" === input.kind || "explicit" === input.kind) && (null !== input.contains && undefined !== input.contains && ("function" === typeof input.contains || "bigint" === typeof input.contains || (Array.isArray(input.contains) && (_it0(input.contains) || false) || "object" === typeof input.contains && null !== input.contains && _iu0(input.contains)))) && "number" === typeof input.value; const _io7 = input => "oid" === input.type && "string" === typeof input.oid; const _io8 = input => "string" === input.type && "printable" === input.kind; const _io9 = input => "string" === input.type && "ia5" === input.kind; const _io10 = input => "string" === input.type && "utf8" === input.kind; const _io11 = input => "date" === input.type && "utc" === input.kind; const _io12 = input => "date" === input.type && "general" === input.kind; const _io13 = input => "struct" === input.type && (Array.isArray(input.fieldNames) && (_ip1(input.fieldNames) || false)) && ("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) && _iu3(input.contains)); const _io14 = input => Object.keys(input).every(key => {
200
+ const value = input[key];
201
+ if (undefined === value)
202
+ return true;
203
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
204
+ }); const _io15 = input => Object.keys(input).every(key => {
205
+ const value = input[key];
206
+ if (undefined === value)
207
+ return true;
208
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
209
+ }); const _io16 = input => Object.keys(input).every(key => {
210
+ const value = input[key];
211
+ if (undefined === value)
212
+ return true;
213
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
214
+ }); const _io17 = input => null !== input.optional && undefined !== input.optional && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_it0(input.optional) || false) || "object" === typeof input.optional && null !== input.optional && _iu0(input.optional))); const _iu0 = input => (() => {
215
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu2(input.choice))
216
+ return _io2(input);
217
+ else if (Array.isArray(input.choice) && (_ip0(input.choice) || false))
218
+ return _io1(input);
219
+ else if (undefined !== input.sequenceOf)
220
+ return _io4(input);
221
+ else if (undefined !== input.optional)
222
+ return _io5(input);
223
+ else if ("context" === input.type)
224
+ return _io6(input);
225
+ else if ("oid" === input.type)
226
+ return _io7(input);
227
+ else if ("general" === input.kind)
228
+ return _io12(input);
229
+ else if ("utc" === input.kind)
230
+ return _io11(input);
231
+ else if ("utf8" === input.kind)
232
+ return _io10(input);
233
+ else if ("ia5" === input.kind)
234
+ return _io9(input);
235
+ else if ("printable" === input.kind)
236
+ return _io8(input);
237
+ else if ("struct" === input.type)
238
+ return _io13(input);
239
+ else
240
+ return false;
241
+ })(); const _iu1 = input => (() => {
242
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu2(input.choice))
243
+ return _io2(input);
244
+ else if (Array.isArray(input.choice) && (_ip0(input.choice) || false))
245
+ return _io1(input);
246
+ else if (undefined !== input.sequenceOf)
247
+ return _io4(input);
248
+ else if ("context" === input.type)
249
+ return _io6(input);
250
+ else if ("oid" === input.type)
251
+ return _io7(input);
252
+ else if ("general" === input.kind)
253
+ return _io12(input);
254
+ else if ("utc" === input.kind)
255
+ return _io11(input);
256
+ else if ("utf8" === input.kind)
257
+ return _io10(input);
258
+ else if ("ia5" === input.kind)
259
+ return _io9(input);
260
+ else if ("printable" === input.kind)
261
+ return _io8(input);
262
+ else if ("struct" === input.type)
263
+ return _io13(input);
264
+ else
265
+ return (() => {
266
+ if (_io5(input))
267
+ return _io5(input);
268
+ if (_io17(input))
269
+ return _io17(input);
270
+ return false;
271
+ })();
272
+ })(); const _iu2 = input => (() => {
273
+ if (_io16(input))
274
+ return _io16(input);
275
+ if (_io3(input))
276
+ return _io3(input);
277
+ return false;
278
+ })(); const _iu3 = input => (() => {
279
+ if (_io15(input))
280
+ return _io15(input);
281
+ if (_io14(input))
282
+ return _io14(input);
283
+ return false;
284
+ })(); const _it0 = input => null !== input[0] && undefined !== input[0] && ("function" === typeof input[0] || "bigint" === typeof input[0] || (Array.isArray(input[0]) && (_it0(input[0]) || false) || "object" === typeof input[0] && null !== input[0] && _iu0(input[0]))) && (Array.isArray(input.slice(1)) && input.slice(1).every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))); const _ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
285
+ const value = input[key];
286
+ if (undefined === value)
287
+ return true;
288
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
289
+ method: "createAssert",
290
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
291
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o16 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
292
+ value: value
293
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
294
+ method: "createAssert",
295
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
296
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o16 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
297
+ value: value
298
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
299
+ method: "createAssert",
300
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
301
+ expected: "readonly [Schema, ...Schema[]]",
302
+ value: value
303
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au1(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
304
+ method: "createAssert",
305
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
306
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o16 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
307
+ value: value
308
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
309
+ method: "createAssert",
310
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
311
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o16 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
312
+ value: value
313
+ }, _errorFactory));
314
+ }); const _ao1 = (input, _path, _exceptionable = true) => (Array.isArray(input.choice) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
315
+ method: "createAssert",
316
+ path: _path + ".choice",
317
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
318
+ value: input.choice
319
+ }, _errorFactory)) && (_ap2(input.choice, _path + ".choice", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
320
+ method: "createAssert",
321
+ path: _path + ".choice",
322
+ expected: "ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>",
323
+ value: input.choice
324
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
325
+ method: "createAssert",
326
+ path: _path + ".choice",
327
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
328
+ value: input.choice
329
+ }, _errorFactory); const _ao2 = (input, _path, _exceptionable = true) => ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
330
+ method: "createAssert",
331
+ path: _path + ".choice",
332
+ expected: "(__type.o15 | __type.o2)",
333
+ value: input.choice
334
+ }, _errorFactory)) && _au2(input.choice, _path + ".choice", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
335
+ method: "createAssert",
336
+ path: _path + ".choice",
337
+ expected: "(__type.o15 | __type.o2)",
338
+ value: input.choice
339
+ }, _errorFactory); const _ao3 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
340
+ const value = input[key];
341
+ if (undefined === value)
342
+ return true;
343
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
344
+ method: "createAssert",
345
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
346
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
347
+ value: value
348
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
349
+ method: "createAssert",
350
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
351
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
352
+ value: value
353
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
354
+ method: "createAssert",
355
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
356
+ expected: "readonly [Schema, ...Schema[]]",
357
+ value: value
358
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
359
+ method: "createAssert",
360
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
361
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
362
+ value: value
363
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
364
+ method: "createAssert",
365
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
366
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
367
+ value: value
368
+ }, _errorFactory));
369
+ }); const _ao4 = (input, _path, _exceptionable = true) => (null !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
370
+ method: "createAssert",
371
+ path: _path + ".sequenceOf",
372
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
373
+ value: input.sequenceOf
374
+ }, _errorFactory)) && (undefined !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
375
+ method: "createAssert",
376
+ path: _path + ".sequenceOf",
377
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
378
+ value: input.sequenceOf
379
+ }, _errorFactory)) && ("function" === typeof input.sequenceOf || "bigint" === typeof input.sequenceOf || (Array.isArray(input.sequenceOf) && (_at0(input.sequenceOf, _path + ".sequenceOf", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
380
+ method: "createAssert",
381
+ path: _path + ".sequenceOf",
382
+ expected: "readonly [Schema, ...Schema[]]",
383
+ value: input.sequenceOf
384
+ }, _errorFactory)) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _au0(input.sequenceOf, _path + ".sequenceOf", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
385
+ method: "createAssert",
386
+ path: _path + ".sequenceOf",
387
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
388
+ value: input.sequenceOf
389
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
390
+ method: "createAssert",
391
+ path: _path + ".sequenceOf",
392
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
393
+ value: input.sequenceOf
394
+ }, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => (null !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
395
+ method: "createAssert",
396
+ path: _path + ".optional",
397
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
398
+ value: input.optional
399
+ }, _errorFactory)) && (undefined !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
400
+ method: "createAssert",
401
+ path: _path + ".optional",
402
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
403
+ value: input.optional
404
+ }, _errorFactory)) && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_at0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
405
+ method: "createAssert",
406
+ path: _path + ".optional",
407
+ expected: "readonly [Schema, ...Schema[]]",
408
+ value: input.optional
409
+ }, _errorFactory)) || "object" === typeof input.optional && null !== input.optional && _au0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
410
+ method: "createAssert",
411
+ path: _path + ".optional",
412
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
413
+ value: input.optional
414
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
415
+ method: "createAssert",
416
+ path: _path + ".optional",
417
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
418
+ value: input.optional
419
+ }, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("context" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
420
+ method: "createAssert",
421
+ path: _path + ".type",
422
+ expected: "\"context\"",
423
+ value: input.type
424
+ }, _errorFactory)) && ("implicit" === input.kind || "explicit" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
425
+ method: "createAssert",
426
+ path: _path + ".kind",
427
+ expected: "(\"explicit\" | \"implicit\")",
428
+ value: input.kind
429
+ }, _errorFactory)) && ((null !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
430
+ method: "createAssert",
431
+ path: _path + ".contains",
432
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
433
+ value: input.contains
434
+ }, _errorFactory)) && (undefined !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
435
+ method: "createAssert",
436
+ path: _path + ".contains",
437
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
438
+ value: input.contains
439
+ }, _errorFactory)) && ("function" === typeof input.contains || "bigint" === typeof input.contains || (Array.isArray(input.contains) && (_at0(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
440
+ method: "createAssert",
441
+ path: _path + ".contains",
442
+ expected: "readonly [Schema, ...Schema[]]",
443
+ value: input.contains
444
+ }, _errorFactory)) || "object" === typeof input.contains && null !== input.contains && _au0(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
445
+ method: "createAssert",
446
+ path: _path + ".contains",
447
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
448
+ value: input.contains
449
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
450
+ method: "createAssert",
451
+ path: _path + ".contains",
452
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
453
+ value: input.contains
454
+ }, _errorFactory))) && ("number" === typeof input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
455
+ method: "createAssert",
456
+ path: _path + ".value",
457
+ expected: "number",
458
+ value: input.value
459
+ }, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => ("oid" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
460
+ method: "createAssert",
461
+ path: _path + ".type",
462
+ expected: "\"oid\"",
463
+ value: input.type
464
+ }, _errorFactory)) && ("string" === typeof input.oid || __typia_transform__assertGuard._assertGuard(_exceptionable, {
465
+ method: "createAssert",
466
+ path: _path + ".oid",
467
+ expected: "string",
468
+ value: input.oid
469
+ }, _errorFactory)); const _ao8 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
470
+ method: "createAssert",
471
+ path: _path + ".type",
472
+ expected: "\"string\"",
473
+ value: input.type
474
+ }, _errorFactory)) && ("printable" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
475
+ method: "createAssert",
476
+ path: _path + ".kind",
477
+ expected: "\"printable\"",
478
+ value: input.kind
479
+ }, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
480
+ method: "createAssert",
481
+ path: _path + ".type",
482
+ expected: "\"string\"",
483
+ value: input.type
484
+ }, _errorFactory)) && ("ia5" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
485
+ method: "createAssert",
486
+ path: _path + ".kind",
487
+ expected: "\"ia5\"",
488
+ value: input.kind
489
+ }, _errorFactory)); const _ao10 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
490
+ method: "createAssert",
491
+ path: _path + ".type",
492
+ expected: "\"string\"",
493
+ value: input.type
494
+ }, _errorFactory)) && ("utf8" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
495
+ method: "createAssert",
496
+ path: _path + ".kind",
497
+ expected: "\"utf8\"",
498
+ value: input.kind
499
+ }, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
500
+ method: "createAssert",
501
+ path: _path + ".type",
502
+ expected: "\"date\"",
503
+ value: input.type
504
+ }, _errorFactory)) && ("utc" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
505
+ method: "createAssert",
506
+ path: _path + ".kind",
507
+ expected: "\"utc\"",
508
+ value: input.kind
509
+ }, _errorFactory)); const _ao12 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
510
+ method: "createAssert",
511
+ path: _path + ".type",
512
+ expected: "\"date\"",
513
+ value: input.type
514
+ }, _errorFactory)) && ("general" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
515
+ method: "createAssert",
516
+ path: _path + ".kind",
517
+ expected: "\"general\"",
518
+ value: input.kind
519
+ }, _errorFactory)); const _ao13 = (input, _path, _exceptionable = true) => ("struct" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
520
+ method: "createAssert",
521
+ path: _path + ".type",
522
+ expected: "\"struct\"",
523
+ value: input.type
524
+ }, _errorFactory)) && ((Array.isArray(input.fieldNames) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
525
+ method: "createAssert",
526
+ path: _path + ".fieldNames",
527
+ expected: "(Array<string> | ReadonlyArray<string>)",
528
+ value: input.fieldNames
529
+ }, _errorFactory)) && (_ap3(input.fieldNames, _path + ".fieldNames", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
530
+ method: "createAssert",
531
+ path: _path + ".fieldNames",
532
+ expected: "Array<string> | ReadonlyArray<string>",
533
+ value: input.fieldNames
534
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
535
+ method: "createAssert",
536
+ path: _path + ".fieldNames",
537
+ expected: "(Array<string> | ReadonlyArray<string>)",
538
+ value: input.fieldNames
539
+ }, _errorFactory)) && (("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
540
+ method: "createAssert",
541
+ path: _path + ".contains",
542
+ expected: "(__type.o13 | __type.o14)",
543
+ value: input.contains
544
+ }, _errorFactory)) && _au3(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
545
+ method: "createAssert",
546
+ path: _path + ".contains",
547
+ expected: "(__type.o13 | __type.o14)",
548
+ value: input.contains
549
+ }, _errorFactory)); const _ao14 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
550
+ const value = input[key];
551
+ if (undefined === value)
552
+ return true;
553
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
554
+ method: "createAssert",
555
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
556
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
557
+ value: value
558
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
559
+ method: "createAssert",
560
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
561
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
562
+ value: value
563
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
564
+ method: "createAssert",
565
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
566
+ expected: "readonly [Schema, ...Schema[]]",
567
+ value: value
568
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
569
+ method: "createAssert",
570
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
571
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
572
+ value: value
573
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
574
+ method: "createAssert",
575
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
576
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
577
+ value: value
578
+ }, _errorFactory));
579
+ }); const _ao15 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
580
+ const value = input[key];
581
+ if (undefined === value)
582
+ return true;
583
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
584
+ method: "createAssert",
585
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
586
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
587
+ value: value
588
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
589
+ method: "createAssert",
590
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
591
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
592
+ value: value
593
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
594
+ method: "createAssert",
595
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
596
+ expected: "readonly [Schema, ...Schema[]]",
597
+ value: value
598
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
599
+ method: "createAssert",
600
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
601
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
602
+ value: value
603
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
604
+ method: "createAssert",
605
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
606
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
607
+ value: value
608
+ }, _errorFactory));
609
+ }); const _ao16 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
610
+ const value = input[key];
611
+ if (undefined === value)
612
+ return true;
613
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
614
+ method: "createAssert",
615
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
616
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
617
+ value: value
618
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
619
+ method: "createAssert",
620
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
621
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
622
+ value: value
623
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
624
+ method: "createAssert",
625
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
626
+ expected: "readonly [Schema, ...Schema[]]",
627
+ value: value
628
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
629
+ method: "createAssert",
630
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
631
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
632
+ value: value
633
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
634
+ method: "createAssert",
635
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
636
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
637
+ value: value
638
+ }, _errorFactory));
639
+ }); const _ao17 = (input, _path, _exceptionable = true) => (null !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
640
+ method: "createAssert",
641
+ path: _path + ".optional",
642
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
643
+ value: input.optional
644
+ }, _errorFactory)) && (undefined !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
645
+ method: "createAssert",
646
+ path: _path + ".optional",
647
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
648
+ value: input.optional
649
+ }, _errorFactory)) && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_at0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
650
+ method: "createAssert",
651
+ path: _path + ".optional",
652
+ expected: "readonly [Schema, ...Schema[]]",
653
+ value: input.optional
654
+ }, _errorFactory)) || "object" === typeof input.optional && null !== input.optional && _au0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
655
+ method: "createAssert",
656
+ path: _path + ".optional",
657
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
658
+ value: input.optional
659
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
660
+ method: "createAssert",
661
+ path: _path + ".optional",
662
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
663
+ value: input.optional
664
+ }, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
665
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _au2(input.choice, _path + ".choice", false && _exceptionable))
666
+ return _ao2(input, _path, true && _exceptionable);
667
+ else if (Array.isArray(input.choice) && (_ap2(input.choice, _path + ".choice", false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
668
+ method: "createAssert",
669
+ path: _path + ".choice",
670
+ expected: "ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>",
671
+ value: input.choice
672
+ }, _errorFactory)))
673
+ return _ao1(input, _path, true && _exceptionable);
674
+ else if (undefined !== input.sequenceOf)
675
+ return _ao4(input, _path, true && _exceptionable);
676
+ else if (undefined !== input.optional)
677
+ return _ao5(input, _path, true && _exceptionable);
678
+ else if ("context" === input.type)
679
+ return _ao6(input, _path, true && _exceptionable);
680
+ else if ("oid" === input.type)
681
+ return _ao7(input, _path, true && _exceptionable);
682
+ else if ("general" === input.kind)
683
+ return _ao12(input, _path, true && _exceptionable);
684
+ else if ("utc" === input.kind)
685
+ return _ao11(input, _path, true && _exceptionable);
686
+ else if ("utf8" === input.kind)
687
+ return _ao10(input, _path, true && _exceptionable);
688
+ else if ("ia5" === input.kind)
689
+ return _ao9(input, _path, true && _exceptionable);
690
+ else if ("printable" === input.kind)
691
+ return _ao8(input, _path, true && _exceptionable);
692
+ else if ("struct" === input.type)
693
+ return _ao13(input, _path, true && _exceptionable);
694
+ else
695
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
696
+ method: "createAssert",
697
+ path: _path,
698
+ expected: "(__type.o1 | __type | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o11 | __type.o10 | __type.o9 | __type.o8 | __type.o7 | __type.o12)",
699
+ value: input
700
+ }, _errorFactory);
701
+ })(); const _au1 = (input, _path, _exceptionable = true) => (() => {
702
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _au2(input.choice, _path + ".choice", false && _exceptionable))
703
+ return _ao2(input, _path, true && _exceptionable);
704
+ else if (Array.isArray(input.choice) && (_ap2(input.choice, _path + ".choice", false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
705
+ method: "createAssert",
706
+ path: _path + ".choice",
707
+ expected: "ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>",
708
+ value: input.choice
709
+ }, _errorFactory)))
710
+ return _ao1(input, _path, true && _exceptionable);
711
+ else if (undefined !== input.sequenceOf)
712
+ return _ao4(input, _path, true && _exceptionable);
713
+ else if ("context" === input.type)
714
+ return _ao6(input, _path, true && _exceptionable);
715
+ else if ("oid" === input.type)
716
+ return _ao7(input, _path, true && _exceptionable);
717
+ else if ("general" === input.kind)
718
+ return _ao12(input, _path, true && _exceptionable);
719
+ else if ("utc" === input.kind)
720
+ return _ao11(input, _path, true && _exceptionable);
721
+ else if ("utf8" === input.kind)
722
+ return _ao10(input, _path, true && _exceptionable);
723
+ else if ("ia5" === input.kind)
724
+ return _ao9(input, _path, true && _exceptionable);
725
+ else if ("printable" === input.kind)
726
+ return _ao8(input, _path, true && _exceptionable);
727
+ else if ("struct" === input.type)
728
+ return _ao13(input, _path, true && _exceptionable);
729
+ else
730
+ return _ao5(input, _path, false && _exceptionable) || _ao17(input, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
731
+ method: "createAssert",
732
+ path: _path,
733
+ expected: "(__type.o4 | __type.o16)",
734
+ value: input
735
+ }, _errorFactory);
736
+ })(); const _au2 = (input, _path, _exceptionable = true) => _ao16(input, _path, false && _exceptionable) || _ao3(input, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
737
+ method: "createAssert",
738
+ path: _path,
739
+ expected: "(__type.o15 | __type.o2)",
740
+ value: input
741
+ }, _errorFactory); const _au3 = (input, _path, _exceptionable = true) => _ao15(input, _path, false && _exceptionable) || _ao14(input, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
742
+ method: "createAssert",
743
+ path: _path,
744
+ expected: "(__type.o14 | __type.o13)",
745
+ value: input
746
+ }, _errorFactory); const _at0 = (input, _path, _exceptionable = true) => (null !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
747
+ method: "createAssert",
748
+ path: _path + "[0]",
749
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
750
+ value: input[0]
751
+ }, _errorFactory)) && (undefined !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
752
+ method: "createAssert",
753
+ path: _path + "[0]",
754
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
755
+ value: input[0]
756
+ }, _errorFactory)) && ("function" === typeof input[0] || "bigint" === typeof input[0] || (Array.isArray(input[0]) && (_at0(input[0], _path + "[0]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
757
+ method: "createAssert",
758
+ path: _path + "[0]",
759
+ expected: "readonly [Schema, ...Schema[]]",
760
+ value: input[0]
761
+ }, _errorFactory)) || "object" === typeof input[0] && null !== input[0] && _au0(input[0], _path + "[0]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
762
+ method: "createAssert",
763
+ path: _path + "[0]",
764
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
765
+ value: input[0]
766
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
767
+ method: "createAssert",
768
+ path: _path + "[0]",
769
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
770
+ value: input[0]
771
+ }, _errorFactory)) && ((Array.isArray(input.slice(1)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
772
+ method: "createAssert",
773
+ path: _path,
774
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
775
+ value: input.slice(1)
776
+ }, _errorFactory)) && input.slice(1).every((elem, _index26) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
777
+ method: "createAssert",
778
+ path: _path + "[" + (1 + _index26) + "]",
779
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
780
+ value: elem
781
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
782
+ method: "createAssert",
783
+ path: _path + "[" + (1 + _index26) + "]",
784
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
785
+ value: elem
786
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + (1 + _index26) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
787
+ method: "createAssert",
788
+ path: _path + "[" + (1 + _index26) + "]",
789
+ expected: "readonly [Schema, ...Schema[]]",
790
+ value: elem
791
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + (1 + _index26) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
792
+ method: "createAssert",
793
+ path: _path + "[" + (1 + _index26) + "]",
794
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
795
+ value: elem
796
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
797
+ method: "createAssert",
798
+ path: _path + "[" + (1 + _index26) + "]",
799
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
800
+ value: elem
801
+ }, _errorFactory))) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
802
+ method: "createAssert",
803
+ path: _path,
804
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
805
+ value: input.slice(1)
806
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); let _errorFactory; return (input, errorFactory) => {
807
+ if (false === __is(input)) {
808
+ _errorFactory = errorFactory;
809
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
810
+ method: "createAssert",
811
+ path: _path + "",
812
+ expected: "StructFieldSchemaMap",
813
+ value: input
814
+ }, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
815
+ method: "createAssert",
816
+ path: _path + "",
817
+ expected: "StructFieldSchemaMap",
818
+ value: input
819
+ }, _errorFactory))(input, "$input", true);
820
+ }
821
+ return input;
822
+ }; })();
823
+ const structSchemaGuard = (() => { const _ip0 = input => {
824
+ const array = input;
825
+ const top = input[0];
826
+ if (0 === input.length)
827
+ return true;
828
+ const arrayPredicators = [
829
+ [
830
+ top => "string" === typeof top,
831
+ entire => entire.every(elem => "string" === typeof elem)
832
+ ],
833
+ [
834
+ top => "string" === typeof top,
835
+ entire => entire.every(elem => "string" === typeof elem)
836
+ ]
837
+ ];
838
+ const passed = arrayPredicators.filter(pred => pred[0](top));
839
+ if (1 === passed.length)
840
+ return passed[0][1](array);
841
+ else if (1 < passed.length)
842
+ for (const pred of passed)
843
+ if (array.every(value => true === pred[0](value)))
844
+ return pred[1](array);
845
+ return false;
846
+ }; const _ip1 = input => {
847
+ const array = input;
848
+ const top = input[0];
849
+ if (0 === input.length)
850
+ return true;
851
+ const arrayPredicators = [
852
+ [
853
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
854
+ entire => entire.every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))
855
+ ],
856
+ [
857
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
858
+ entire => entire.every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))
859
+ ]
860
+ ];
861
+ const passed = arrayPredicators.filter(pred => pred[0](top));
862
+ if (1 === passed.length)
863
+ return passed[0][1](array);
864
+ else if (1 < passed.length)
865
+ for (const pred of passed)
866
+ if (array.every(value => true === pred[0](value)))
867
+ return pred[1](array);
868
+ return false;
869
+ }; const _io0 = input => "struct" === input.type && (Array.isArray(input.fieldNames) && (_ip0(input.fieldNames) || false)) && ("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) && _iu1(input.contains)); const _io1 = input => Object.keys(input).every(key => {
870
+ const value = input[key];
871
+ if (undefined === value)
872
+ return true;
873
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
874
+ }); const _io2 = input => Array.isArray(input.choice) && (_ip1(input.choice) || false); const _io3 = input => "object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu2(input.choice); const _io4 = input => Object.keys(input).every(key => {
875
+ const value = input[key];
876
+ if (undefined === value)
877
+ return true;
878
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
879
+ }); const _io5 = input => null !== input.sequenceOf && undefined !== input.sequenceOf && ("function" === typeof input.sequenceOf || "bigint" === typeof input.sequenceOf || (Array.isArray(input.sequenceOf) && (_it0(input.sequenceOf) || false) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _iu0(input.sequenceOf))); const _io6 = input => null !== input.optional && undefined !== input.optional && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_it0(input.optional) || false) || "object" === typeof input.optional && null !== input.optional && _iu0(input.optional))); const _io7 = input => "context" === input.type && ("implicit" === input.kind || "explicit" === input.kind) && (null !== input.contains && undefined !== input.contains && ("function" === typeof input.contains || "bigint" === typeof input.contains || (Array.isArray(input.contains) && (_it0(input.contains) || false) || "object" === typeof input.contains && null !== input.contains && _iu0(input.contains)))) && "number" === typeof input.value; const _io8 = input => "oid" === input.type && "string" === typeof input.oid; const _io9 = input => "string" === input.type && "printable" === input.kind; const _io10 = input => "string" === input.type && "ia5" === input.kind; const _io11 = input => "string" === input.type && "utf8" === input.kind; const _io12 = input => "date" === input.type && "utc" === input.kind; const _io13 = input => "date" === input.type && "general" === input.kind; const _io14 = input => Object.keys(input).every(key => {
880
+ const value = input[key];
881
+ if (undefined === value)
882
+ return true;
883
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
884
+ }); const _io15 = input => Object.keys(input).every(key => {
885
+ const value = input[key];
886
+ if (undefined === value)
887
+ return true;
888
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
889
+ }); const _iu0 = input => (() => {
890
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu2(input.choice))
891
+ return _io3(input);
892
+ else if (Array.isArray(input.choice) && (_ip1(input.choice) || false))
893
+ return _io2(input);
894
+ else if (undefined !== input.sequenceOf)
895
+ return _io5(input);
896
+ else if (undefined !== input.optional)
897
+ return _io6(input);
898
+ else if ("context" === input.type)
899
+ return _io7(input);
900
+ else if ("oid" === input.type)
901
+ return _io8(input);
902
+ else if ("general" === input.kind)
903
+ return _io13(input);
904
+ else if ("utc" === input.kind)
905
+ return _io12(input);
906
+ else if ("utf8" === input.kind)
907
+ return _io11(input);
908
+ else if ("ia5" === input.kind)
909
+ return _io10(input);
910
+ else if ("printable" === input.kind)
911
+ return _io9(input);
912
+ else if ("struct" === input.type)
913
+ return _io0(input);
914
+ else
915
+ return false;
916
+ })(); const _iu1 = input => (() => {
917
+ if (_io15(input))
918
+ return _io15(input);
919
+ if (_io1(input))
920
+ return _io1(input);
921
+ return false;
922
+ })(); const _iu2 = input => (() => {
923
+ if (_io14(input))
924
+ return _io14(input);
925
+ if (_io4(input))
926
+ return _io4(input);
927
+ return false;
928
+ })(); const _it0 = input => null !== input[0] && undefined !== input[0] && ("function" === typeof input[0] || "bigint" === typeof input[0] || (Array.isArray(input[0]) && (_it0(input[0]) || false) || "object" === typeof input[0] && null !== input[0] && _iu0(input[0]))) && (Array.isArray(input.slice(1)) && input.slice(1).every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))); return input => "object" === typeof input && null !== input && _io0(input); })();
929
+ const structSchemaCache = new WeakMap();
930
+ function defaultPrintValue(value) {
931
+ try {
932
+ return (JSON.stringify(value));
933
+ }
934
+ catch {
935
+ return (String(value));
936
+ }
937
+ }
938
+ function isOptionalSchema(candidate) {
939
+ return (typeof candidate === 'object' && candidate !== null && 'optional' in candidate);
940
+ }
941
+ function isStructSchema(candidate) {
942
+ return (structSchemaGuard(candidate));
943
+ }
944
+ function ensureStructContains(schema) {
945
+ if (!schema.contains) {
946
+ return ({});
947
+ }
948
+ return (assertStructFieldSchemaMap(schema.contains));
949
+ }
950
+ function isPlainObject(value) {
951
+ return (typeof value === 'object' && value !== null && !Array.isArray(value));
952
+ }
953
+ function getFieldNames(schema) {
954
+ return (Array.isArray(schema.fieldNames) && schema.fieldNames.length > 0
955
+ ? [...schema.fieldNames]
956
+ : Object.keys(ensureStructContains(schema)));
957
+ }
958
+ export function contextualizeStructSchema(schema) {
959
+ if (!isStructSchema(schema)) {
960
+ return (schema);
961
+ }
962
+ const cached = structSchemaCache.get(schema);
963
+ if (cached) {
964
+ return (cached);
965
+ }
966
+ const fieldNames = getFieldNames(schema);
967
+ const structContains = ensureStructContains(schema);
968
+ const contextualizedContains = {};
969
+ function wrapWithExplicitContext(index, innerSchema) {
970
+ if (typeof innerSchema === 'object' && innerSchema !== null && 'type' in innerSchema && innerSchema.type === 'context') {
971
+ return (innerSchema);
972
+ }
973
+ return ({
974
+ type: 'context',
975
+ kind: 'explicit',
976
+ value: index,
977
+ contains: contextualizeStructSchema(innerSchema)
978
+ });
979
+ }
980
+ for (const [index, fieldName] of fieldNames.entries()) {
981
+ const fieldSchema = structContains[fieldName];
982
+ if (!fieldSchema) {
983
+ continue;
984
+ }
985
+ if (isOptionalSchema(fieldSchema)) {
986
+ contextualizedContains[fieldName] = {
987
+ optional: wrapWithExplicitContext(index, fieldSchema.optional)
988
+ };
989
+ continue;
990
+ }
991
+ contextualizedContains[fieldName] = wrapWithExplicitContext(index, fieldSchema);
992
+ }
993
+ const contextualized = {
994
+ type: 'struct',
995
+ fieldNames,
996
+ contains: contextualizedContains
997
+ };
998
+ structSchemaCache.set(schema, contextualized);
999
+ return (contextualized);
1000
+ }
1001
+ function resolveSchema(schema) {
1002
+ let current = schema;
1003
+ while (typeof current === 'function') {
1004
+ current = current();
1005
+ }
1006
+ return (current);
1007
+ }
1008
+ function prepareContextValue(schema, value, prepare) {
1009
+ if (value === undefined) {
1010
+ return (value);
1011
+ }
1012
+ if (isASN1ContextTag(value)) {
1013
+ const preparedContains = prepare(schema.contains, value.contains);
1014
+ if (preparedContains !== value.contains) {
1015
+ return ({
1016
+ type: 'context',
1017
+ kind: value.kind,
1018
+ value: value.value,
1019
+ contains: preparedContains
1020
+ });
1021
+ }
1022
+ return (value);
1023
+ }
1024
+ const contains = prepare(schema.contains, value);
1025
+ return ({
1026
+ type: 'context',
1027
+ kind: schema.kind,
1028
+ value: schema.value,
1029
+ contains
1030
+ });
1031
+ }
1032
+ function prepareStructValue(schema, value) {
1033
+ const structContains = schema.contains ?? {};
1034
+ const fieldNames = getFieldNames(schema);
1035
+ if (isASN1Struct(value)) {
1036
+ const preparedContains = {};
1037
+ for (const [fieldName, fieldValue] of Object.entries(value.contains ?? {})) {
1038
+ const fieldSchema = structContains[fieldName];
1039
+ if (!fieldSchema) {
1040
+ preparedContains[fieldName] = fieldValue;
1041
+ continue;
1042
+ }
1043
+ const innerSchema = isOptionalSchema(fieldSchema) ? fieldSchema.optional : fieldSchema;
1044
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
1045
+ preparedContains[fieldName] = prepareValueForSchema(innerSchema, fieldValue);
1046
+ }
1047
+ return ({
1048
+ type: 'struct',
1049
+ fieldNames: value.fieldNames ?? fieldNames,
1050
+ contains: preparedContains
1051
+ });
1052
+ }
1053
+ if (!isPlainObject(value)) {
1054
+ return (value);
1055
+ }
1056
+ const preparedContains = {};
1057
+ for (const fieldName of fieldNames) {
1058
+ const fieldSchema = structContains[fieldName];
1059
+ if (!fieldSchema) {
1060
+ continue;
1061
+ }
1062
+ const fieldValue = value[fieldName];
1063
+ if (fieldValue === undefined) {
1064
+ if (!isOptionalSchema(fieldSchema)) {
1065
+ preparedContains[fieldName] = fieldValue;
1066
+ }
1067
+ continue;
1068
+ }
1069
+ const innerSchema = isOptionalSchema(fieldSchema) ? fieldSchema.optional : fieldSchema;
1070
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
1071
+ preparedContains[fieldName] = prepareValueForSchema(innerSchema, fieldValue);
1072
+ }
1073
+ return ({
1074
+ type: 'struct',
1075
+ fieldNames,
1076
+ contains: preparedContains
1077
+ });
1078
+ }
1079
+ function prepareValueForSchema(schema, value) {
1080
+ const resolved = resolveSchema(schema);
1081
+ if (value === undefined || value === null) {
1082
+ return (value);
1083
+ }
1084
+ if (Array.isArray(resolved)) {
1085
+ if (!Array.isArray(value)) {
1086
+ return (value);
1087
+ }
1088
+ const result = [];
1089
+ for (let i = 0; i < resolved.length; i++) {
1090
+ result.push(prepareValueForSchema((() => { const _ip0 = input => {
1091
+ const array = input;
1092
+ const top = input[0];
1093
+ if (0 === input.length)
1094
+ return true;
1095
+ const arrayPredicators = [
1096
+ [
1097
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
1098
+ entire => entire.every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))
1099
+ ],
1100
+ [
1101
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
1102
+ entire => entire.every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))
1103
+ ]
1104
+ ];
1105
+ const passed = arrayPredicators.filter(pred => pred[0](top));
1106
+ if (1 === passed.length)
1107
+ return passed[0][1](array);
1108
+ else if (1 < passed.length)
1109
+ for (const pred of passed)
1110
+ if (array.every(value => true === pred[0](value)))
1111
+ return pred[1](array);
1112
+ return false;
1113
+ }; const _ip1 = input => {
1114
+ const array = input;
1115
+ const top = input[0];
1116
+ if (0 === input.length)
1117
+ return true;
1118
+ const arrayPredicators = [
1119
+ [
1120
+ top => "string" === typeof top,
1121
+ entire => entire.every(elem => "string" === typeof elem)
1122
+ ],
1123
+ [
1124
+ top => "string" === typeof top,
1125
+ entire => entire.every(elem => "string" === typeof elem)
1126
+ ]
1127
+ ];
1128
+ const passed = arrayPredicators.filter(pred => pred[0](top));
1129
+ if (1 === passed.length)
1130
+ return passed[0][1](array);
1131
+ else if (1 < passed.length)
1132
+ for (const pred of passed)
1133
+ if (array.every(value => true === pred[0](value)))
1134
+ return pred[1](array);
1135
+ return false;
1136
+ }; const _ap2 = (input, _path, _exceptionable = true) => {
1137
+ const array = input;
1138
+ const top = input[0];
1139
+ if (0 === input.length)
1140
+ return true;
1141
+ const arrayPredicators = [
1142
+ [
1143
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1144
+ method: "assert",
1145
+ path: _path,
1146
+ expected: "readonly [Schema, ...Schema[]]",
1147
+ value: top
1148
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
1149
+ entire => entire.every((elem, _index14) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1150
+ method: "assert",
1151
+ path: _path + "[" + _index14 + "]",
1152
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1153
+ value: elem
1154
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1155
+ method: "assert",
1156
+ path: _path + "[" + _index14 + "]",
1157
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1158
+ value: elem
1159
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index14 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1160
+ method: "assert",
1161
+ path: _path + "[" + _index14 + "]",
1162
+ expected: "readonly [Schema, ...Schema[]]",
1163
+ value: elem
1164
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index14 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1165
+ method: "assert",
1166
+ path: _path + "[" + _index14 + "]",
1167
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1168
+ value: elem
1169
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1170
+ method: "assert",
1171
+ path: _path + "[" + _index14 + "]",
1172
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1173
+ value: elem
1174
+ }, _errorFactory)))
1175
+ ],
1176
+ [
1177
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1178
+ method: "assert",
1179
+ path: _path,
1180
+ expected: "readonly [Schema, ...Schema[]]",
1181
+ value: top
1182
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
1183
+ entire => entire.every((elem, _index15) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1184
+ method: "assert",
1185
+ path: _path + "[" + _index15 + "]",
1186
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1187
+ value: elem
1188
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1189
+ method: "assert",
1190
+ path: _path + "[" + _index15 + "]",
1191
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1192
+ value: elem
1193
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index15 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1194
+ method: "assert",
1195
+ path: _path + "[" + _index15 + "]",
1196
+ expected: "readonly [Schema, ...Schema[]]",
1197
+ value: elem
1198
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index15 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1199
+ method: "assert",
1200
+ path: _path + "[" + _index15 + "]",
1201
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1202
+ value: elem
1203
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1204
+ method: "assert",
1205
+ path: _path + "[" + _index15 + "]",
1206
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1207
+ value: elem
1208
+ }, _errorFactory)))
1209
+ ]
1210
+ ];
1211
+ const passed = arrayPredicators.filter(pred => pred[0](top));
1212
+ if (1 === passed.length)
1213
+ return passed[0][1](array);
1214
+ else if (1 < passed.length)
1215
+ for (const pred of passed)
1216
+ if (array.every(value => true === pred[0](value)))
1217
+ return pred[1](array);
1218
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
1219
+ method: "assert",
1220
+ path: _path,
1221
+ expected: "(ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>)",
1222
+ value: input
1223
+ }, _errorFactory);
1224
+ }; const _ap3 = (input, _path, _exceptionable = true) => {
1225
+ const array = input;
1226
+ const top = input[0];
1227
+ if (0 === input.length)
1228
+ return true;
1229
+ const arrayPredicators = [
1230
+ [
1231
+ top => "string" === typeof top,
1232
+ entire => entire.every((elem, _index18) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1233
+ method: "assert",
1234
+ path: _path + "[" + _index18 + "]",
1235
+ expected: "string",
1236
+ value: elem
1237
+ }, _errorFactory))
1238
+ ],
1239
+ [
1240
+ top => "string" === typeof top,
1241
+ entire => entire.every((elem, _index19) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1242
+ method: "assert",
1243
+ path: _path + "[" + _index19 + "]",
1244
+ expected: "string",
1245
+ value: elem
1246
+ }, _errorFactory))
1247
+ ]
1248
+ ];
1249
+ const passed = arrayPredicators.filter(pred => pred[0](top));
1250
+ if (1 === passed.length)
1251
+ return passed[0][1](array);
1252
+ else if (1 < passed.length)
1253
+ for (const pred of passed)
1254
+ if (array.every(value => true === pred[0](value)))
1255
+ return pred[1](array);
1256
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
1257
+ method: "assert",
1258
+ path: _path,
1259
+ expected: "(Array<string> | ReadonlyArray<string>)",
1260
+ value: input
1261
+ }, _errorFactory);
1262
+ }; const _io0 = input => Array.isArray(input.choice) && (_ip0(input.choice) || false); const _io1 = input => "object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu1(input.choice); const _io2 = input => Object.keys(input).every(key => {
1263
+ const value = input[key];
1264
+ if (undefined === value)
1265
+ return true;
1266
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
1267
+ }); const _io3 = input => null !== input.sequenceOf && undefined !== input.sequenceOf && ("function" === typeof input.sequenceOf || "bigint" === typeof input.sequenceOf || (Array.isArray(input.sequenceOf) && (_it0(input.sequenceOf) || false) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _iu0(input.sequenceOf))); const _io4 = input => null !== input.optional && undefined !== input.optional && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_it0(input.optional) || false) || "object" === typeof input.optional && null !== input.optional && _iu0(input.optional))); const _io5 = input => "context" === input.type && ("implicit" === input.kind || "explicit" === input.kind) && (null !== input.contains && undefined !== input.contains && ("function" === typeof input.contains || "bigint" === typeof input.contains || (Array.isArray(input.contains) && (_it0(input.contains) || false) || "object" === typeof input.contains && null !== input.contains && _iu0(input.contains)))) && "number" === typeof input.value; const _io6 = input => "oid" === input.type && "string" === typeof input.oid; const _io7 = input => "string" === input.type && "printable" === input.kind; const _io8 = input => "string" === input.type && "ia5" === input.kind; const _io9 = input => "string" === input.type && "utf8" === input.kind; const _io10 = input => "date" === input.type && "utc" === input.kind; const _io11 = input => "date" === input.type && "general" === input.kind; const _io12 = input => "struct" === input.type && (Array.isArray(input.fieldNames) && (_ip1(input.fieldNames) || false)) && ("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) && _iu2(input.contains)); const _io13 = input => Object.keys(input).every(key => {
1268
+ const value = input[key];
1269
+ if (undefined === value)
1270
+ return true;
1271
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
1272
+ }); const _io14 = input => Object.keys(input).every(key => {
1273
+ const value = input[key];
1274
+ if (undefined === value)
1275
+ return true;
1276
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
1277
+ }); const _io15 = input => Object.keys(input).every(key => {
1278
+ const value = input[key];
1279
+ if (undefined === value)
1280
+ return true;
1281
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
1282
+ }); const _iu0 = input => (() => {
1283
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _iu1(input.choice))
1284
+ return _io1(input);
1285
+ else if (Array.isArray(input.choice) && (_ip0(input.choice) || false))
1286
+ return _io0(input);
1287
+ else if (undefined !== input.sequenceOf)
1288
+ return _io3(input);
1289
+ else if (undefined !== input.optional)
1290
+ return _io4(input);
1291
+ else if ("context" === input.type)
1292
+ return _io5(input);
1293
+ else if ("oid" === input.type)
1294
+ return _io6(input);
1295
+ else if ("general" === input.kind)
1296
+ return _io11(input);
1297
+ else if ("utc" === input.kind)
1298
+ return _io10(input);
1299
+ else if ("utf8" === input.kind)
1300
+ return _io9(input);
1301
+ else if ("ia5" === input.kind)
1302
+ return _io8(input);
1303
+ else if ("printable" === input.kind)
1304
+ return _io7(input);
1305
+ else if ("struct" === input.type)
1306
+ return _io12(input);
1307
+ else
1308
+ return false;
1309
+ })(); const _iu1 = input => (() => {
1310
+ if (_io15(input))
1311
+ return _io15(input);
1312
+ if (_io2(input))
1313
+ return _io2(input);
1314
+ return false;
1315
+ })(); const _iu2 = input => (() => {
1316
+ if (_io14(input))
1317
+ return _io14(input);
1318
+ if (_io13(input))
1319
+ return _io13(input);
1320
+ return false;
1321
+ })(); const _it0 = input => null !== input[0] && undefined !== input[0] && ("function" === typeof input[0] || "bigint" === typeof input[0] || (Array.isArray(input[0]) && (_it0(input[0]) || false) || "object" === typeof input[0] && null !== input[0] && _iu0(input[0]))) && (Array.isArray(input.slice(1)) && input.slice(1).every(elem => null !== elem && undefined !== elem && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_it0(elem) || false) || "object" === typeof elem && null !== elem && _iu0(elem))))); const _ao0 = (input, _path, _exceptionable = true) => (Array.isArray(input.choice) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1322
+ method: "assert",
1323
+ path: _path + ".choice",
1324
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
1325
+ value: input.choice
1326
+ }, _errorFactory)) && (_ap2(input.choice, _path + ".choice", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1327
+ method: "assert",
1328
+ path: _path + ".choice",
1329
+ expected: "ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>",
1330
+ value: input.choice
1331
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1332
+ method: "assert",
1333
+ path: _path + ".choice",
1334
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
1335
+ value: input.choice
1336
+ }, _errorFactory); const _ao1 = (input, _path, _exceptionable = true) => ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1337
+ method: "assert",
1338
+ path: _path + ".choice",
1339
+ expected: "(__type.o15 | __type.o2)",
1340
+ value: input.choice
1341
+ }, _errorFactory)) && _au1(input.choice, _path + ".choice", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1342
+ method: "assert",
1343
+ path: _path + ".choice",
1344
+ expected: "(__type.o15 | __type.o2)",
1345
+ value: input.choice
1346
+ }, _errorFactory); const _ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1347
+ const value = input[key];
1348
+ if (undefined === value)
1349
+ return true;
1350
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1351
+ method: "assert",
1352
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1353
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1354
+ value: value
1355
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1356
+ method: "assert",
1357
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1358
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1359
+ value: value
1360
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1361
+ method: "assert",
1362
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1363
+ expected: "readonly [Schema, ...Schema[]]",
1364
+ value: value
1365
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1366
+ method: "assert",
1367
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1368
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1369
+ value: value
1370
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1371
+ method: "assert",
1372
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1373
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1374
+ value: value
1375
+ }, _errorFactory));
1376
+ }); const _ao3 = (input, _path, _exceptionable = true) => (null !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1377
+ method: "assert",
1378
+ path: _path + ".sequenceOf",
1379
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1380
+ value: input.sequenceOf
1381
+ }, _errorFactory)) && (undefined !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1382
+ method: "assert",
1383
+ path: _path + ".sequenceOf",
1384
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1385
+ value: input.sequenceOf
1386
+ }, _errorFactory)) && ("function" === typeof input.sequenceOf || "bigint" === typeof input.sequenceOf || (Array.isArray(input.sequenceOf) && (_at0(input.sequenceOf, _path + ".sequenceOf", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1387
+ method: "assert",
1388
+ path: _path + ".sequenceOf",
1389
+ expected: "readonly [Schema, ...Schema[]]",
1390
+ value: input.sequenceOf
1391
+ }, _errorFactory)) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _au0(input.sequenceOf, _path + ".sequenceOf", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1392
+ method: "assert",
1393
+ path: _path + ".sequenceOf",
1394
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1395
+ value: input.sequenceOf
1396
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1397
+ method: "assert",
1398
+ path: _path + ".sequenceOf",
1399
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1400
+ value: input.sequenceOf
1401
+ }, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => (null !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1402
+ method: "assert",
1403
+ path: _path + ".optional",
1404
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1405
+ value: input.optional
1406
+ }, _errorFactory)) && (undefined !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1407
+ method: "assert",
1408
+ path: _path + ".optional",
1409
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1410
+ value: input.optional
1411
+ }, _errorFactory)) && ("function" === typeof input.optional || "bigint" === typeof input.optional || (Array.isArray(input.optional) && (_at0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1412
+ method: "assert",
1413
+ path: _path + ".optional",
1414
+ expected: "readonly [Schema, ...Schema[]]",
1415
+ value: input.optional
1416
+ }, _errorFactory)) || "object" === typeof input.optional && null !== input.optional && _au0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1417
+ method: "assert",
1418
+ path: _path + ".optional",
1419
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1420
+ value: input.optional
1421
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1422
+ method: "assert",
1423
+ path: _path + ".optional",
1424
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1425
+ value: input.optional
1426
+ }, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("context" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1427
+ method: "assert",
1428
+ path: _path + ".type",
1429
+ expected: "\"context\"",
1430
+ value: input.type
1431
+ }, _errorFactory)) && ("implicit" === input.kind || "explicit" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1432
+ method: "assert",
1433
+ path: _path + ".kind",
1434
+ expected: "(\"explicit\" | \"implicit\")",
1435
+ value: input.kind
1436
+ }, _errorFactory)) && ((null !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1437
+ method: "assert",
1438
+ path: _path + ".contains",
1439
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1440
+ value: input.contains
1441
+ }, _errorFactory)) && (undefined !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1442
+ method: "assert",
1443
+ path: _path + ".contains",
1444
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1445
+ value: input.contains
1446
+ }, _errorFactory)) && ("function" === typeof input.contains || "bigint" === typeof input.contains || (Array.isArray(input.contains) && (_at0(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1447
+ method: "assert",
1448
+ path: _path + ".contains",
1449
+ expected: "readonly [Schema, ...Schema[]]",
1450
+ value: input.contains
1451
+ }, _errorFactory)) || "object" === typeof input.contains && null !== input.contains && _au0(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1452
+ method: "assert",
1453
+ path: _path + ".contains",
1454
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1455
+ value: input.contains
1456
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1457
+ method: "assert",
1458
+ path: _path + ".contains",
1459
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1460
+ value: input.contains
1461
+ }, _errorFactory))) && ("number" === typeof input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1462
+ method: "assert",
1463
+ path: _path + ".value",
1464
+ expected: "number",
1465
+ value: input.value
1466
+ }, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("oid" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1467
+ method: "assert",
1468
+ path: _path + ".type",
1469
+ expected: "\"oid\"",
1470
+ value: input.type
1471
+ }, _errorFactory)) && ("string" === typeof input.oid || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1472
+ method: "assert",
1473
+ path: _path + ".oid",
1474
+ expected: "string",
1475
+ value: input.oid
1476
+ }, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1477
+ method: "assert",
1478
+ path: _path + ".type",
1479
+ expected: "\"string\"",
1480
+ value: input.type
1481
+ }, _errorFactory)) && ("printable" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1482
+ method: "assert",
1483
+ path: _path + ".kind",
1484
+ expected: "\"printable\"",
1485
+ value: input.kind
1486
+ }, _errorFactory)); const _ao8 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1487
+ method: "assert",
1488
+ path: _path + ".type",
1489
+ expected: "\"string\"",
1490
+ value: input.type
1491
+ }, _errorFactory)) && ("ia5" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1492
+ method: "assert",
1493
+ path: _path + ".kind",
1494
+ expected: "\"ia5\"",
1495
+ value: input.kind
1496
+ }, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1497
+ method: "assert",
1498
+ path: _path + ".type",
1499
+ expected: "\"string\"",
1500
+ value: input.type
1501
+ }, _errorFactory)) && ("utf8" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1502
+ method: "assert",
1503
+ path: _path + ".kind",
1504
+ expected: "\"utf8\"",
1505
+ value: input.kind
1506
+ }, _errorFactory)); const _ao10 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1507
+ method: "assert",
1508
+ path: _path + ".type",
1509
+ expected: "\"date\"",
1510
+ value: input.type
1511
+ }, _errorFactory)) && ("utc" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1512
+ method: "assert",
1513
+ path: _path + ".kind",
1514
+ expected: "\"utc\"",
1515
+ value: input.kind
1516
+ }, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1517
+ method: "assert",
1518
+ path: _path + ".type",
1519
+ expected: "\"date\"",
1520
+ value: input.type
1521
+ }, _errorFactory)) && ("general" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1522
+ method: "assert",
1523
+ path: _path + ".kind",
1524
+ expected: "\"general\"",
1525
+ value: input.kind
1526
+ }, _errorFactory)); const _ao12 = (input, _path, _exceptionable = true) => ("struct" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1527
+ method: "assert",
1528
+ path: _path + ".type",
1529
+ expected: "\"struct\"",
1530
+ value: input.type
1531
+ }, _errorFactory)) && ((Array.isArray(input.fieldNames) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1532
+ method: "assert",
1533
+ path: _path + ".fieldNames",
1534
+ expected: "(Array<string> | ReadonlyArray<string>)",
1535
+ value: input.fieldNames
1536
+ }, _errorFactory)) && (_ap3(input.fieldNames, _path + ".fieldNames", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1537
+ method: "assert",
1538
+ path: _path + ".fieldNames",
1539
+ expected: "Array<string> | ReadonlyArray<string>",
1540
+ value: input.fieldNames
1541
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1542
+ method: "assert",
1543
+ path: _path + ".fieldNames",
1544
+ expected: "(Array<string> | ReadonlyArray<string>)",
1545
+ value: input.fieldNames
1546
+ }, _errorFactory)) && (("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1547
+ method: "assert",
1548
+ path: _path + ".contains",
1549
+ expected: "(__type.o13 | __type.o14)",
1550
+ value: input.contains
1551
+ }, _errorFactory)) && _au2(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1552
+ method: "assert",
1553
+ path: _path + ".contains",
1554
+ expected: "(__type.o13 | __type.o14)",
1555
+ value: input.contains
1556
+ }, _errorFactory)); const _ao13 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1557
+ const value = input[key];
1558
+ if (undefined === value)
1559
+ return true;
1560
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1561
+ method: "assert",
1562
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1563
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1564
+ value: value
1565
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1566
+ method: "assert",
1567
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1568
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1569
+ value: value
1570
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1571
+ method: "assert",
1572
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1573
+ expected: "readonly [Schema, ...Schema[]]",
1574
+ value: value
1575
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1576
+ method: "assert",
1577
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1578
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1579
+ value: value
1580
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1581
+ method: "assert",
1582
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1583
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1584
+ value: value
1585
+ }, _errorFactory));
1586
+ }); const _ao14 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1587
+ const value = input[key];
1588
+ if (undefined === value)
1589
+ return true;
1590
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1591
+ method: "assert",
1592
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1593
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1594
+ value: value
1595
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1596
+ method: "assert",
1597
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1598
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1599
+ value: value
1600
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1601
+ method: "assert",
1602
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1603
+ expected: "readonly [Schema, ...Schema[]]",
1604
+ value: value
1605
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1606
+ method: "assert",
1607
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1608
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1609
+ value: value
1610
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1611
+ method: "assert",
1612
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1613
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1614
+ value: value
1615
+ }, _errorFactory));
1616
+ }); const _ao15 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1617
+ const value = input[key];
1618
+ if (undefined === value)
1619
+ return true;
1620
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1621
+ method: "assert",
1622
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1623
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1624
+ value: value
1625
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1626
+ method: "assert",
1627
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1628
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1629
+ value: value
1630
+ }, _errorFactory)) && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_at0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1631
+ method: "assert",
1632
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1633
+ expected: "readonly [Schema, ...Schema[]]",
1634
+ value: value
1635
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1636
+ method: "assert",
1637
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1638
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1639
+ value: value
1640
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1641
+ method: "assert",
1642
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1643
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1644
+ value: value
1645
+ }, _errorFactory));
1646
+ }); const _au0 = (input, _path, _exceptionable = true) => (() => {
1647
+ if ("object" === typeof input.choice && null !== input.choice && false === Array.isArray(input.choice) && _au1(input.choice, _path + ".choice", false && _exceptionable))
1648
+ return _ao1(input, _path, true && _exceptionable);
1649
+ else if (Array.isArray(input.choice) && (_ap2(input.choice, _path + ".choice", false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1650
+ method: "assert",
1651
+ path: _path + ".choice",
1652
+ expected: "ReadonlyArray<ValidateASN1.Schema> | Array<ValidateASN1.Schema>",
1653
+ value: input.choice
1654
+ }, _errorFactory)))
1655
+ return _ao0(input, _path, true && _exceptionable);
1656
+ else if (undefined !== input.sequenceOf)
1657
+ return _ao3(input, _path, true && _exceptionable);
1658
+ else if (undefined !== input.optional)
1659
+ return _ao4(input, _path, true && _exceptionable);
1660
+ else if ("context" === input.type)
1661
+ return _ao5(input, _path, true && _exceptionable);
1662
+ else if ("oid" === input.type)
1663
+ return _ao6(input, _path, true && _exceptionable);
1664
+ else if ("general" === input.kind)
1665
+ return _ao11(input, _path, true && _exceptionable);
1666
+ else if ("utc" === input.kind)
1667
+ return _ao10(input, _path, true && _exceptionable);
1668
+ else if ("utf8" === input.kind)
1669
+ return _ao9(input, _path, true && _exceptionable);
1670
+ else if ("ia5" === input.kind)
1671
+ return _ao8(input, _path, true && _exceptionable);
1672
+ else if ("printable" === input.kind)
1673
+ return _ao7(input, _path, true && _exceptionable);
1674
+ else if ("struct" === input.type)
1675
+ return _ao12(input, _path, true && _exceptionable);
1676
+ else
1677
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
1678
+ method: "assert",
1679
+ path: _path,
1680
+ expected: "(__type.o1 | __type | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o11 | __type.o10 | __type.o9 | __type.o8 | __type.o7 | __type.o12)",
1681
+ value: input
1682
+ }, _errorFactory);
1683
+ })(); const _au1 = (input, _path, _exceptionable = true) => _ao15(input, _path, false && _exceptionable) || _ao2(input, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1684
+ method: "assert",
1685
+ path: _path,
1686
+ expected: "(__type.o15 | __type.o2)",
1687
+ value: input
1688
+ }, _errorFactory); const _au2 = (input, _path, _exceptionable = true) => _ao14(input, _path, false && _exceptionable) || _ao13(input, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1689
+ method: "assert",
1690
+ path: _path,
1691
+ expected: "(__type.o14 | __type.o13)",
1692
+ value: input
1693
+ }, _errorFactory); const _at0 = (input, _path, _exceptionable = true) => (null !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1694
+ method: "assert",
1695
+ path: _path + "[0]",
1696
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1697
+ value: input[0]
1698
+ }, _errorFactory)) && (undefined !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1699
+ method: "assert",
1700
+ path: _path + "[0]",
1701
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1702
+ value: input[0]
1703
+ }, _errorFactory)) && ("function" === typeof input[0] || "bigint" === typeof input[0] || (Array.isArray(input[0]) && (_at0(input[0], _path + "[0]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1704
+ method: "assert",
1705
+ path: _path + "[0]",
1706
+ expected: "readonly [Schema, ...Schema[]]",
1707
+ value: input[0]
1708
+ }, _errorFactory)) || "object" === typeof input[0] && null !== input[0] && _au0(input[0], _path + "[0]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1709
+ method: "assert",
1710
+ path: _path + "[0]",
1711
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1712
+ value: input[0]
1713
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1714
+ method: "assert",
1715
+ path: _path + "[0]",
1716
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1717
+ value: input[0]
1718
+ }, _errorFactory)) && ((Array.isArray(input.slice(1)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1719
+ method: "assert",
1720
+ path: _path,
1721
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1722
+ value: input.slice(1)
1723
+ }, _errorFactory)) && input.slice(1).every((elem, _index22) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1724
+ method: "assert",
1725
+ path: _path + "[" + (1 + _index22) + "]",
1726
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1727
+ value: elem
1728
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1729
+ method: "assert",
1730
+ path: _path + "[" + (1 + _index22) + "]",
1731
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1732
+ value: elem
1733
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + (1 + _index22) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1734
+ method: "assert",
1735
+ path: _path + "[" + (1 + _index22) + "]",
1736
+ expected: "readonly [Schema, ...Schema[]]",
1737
+ value: elem
1738
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + (1 + _index22) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1739
+ method: "assert",
1740
+ path: _path + "[" + (1 + _index22) + "]",
1741
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1742
+ value: elem
1743
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1744
+ method: "assert",
1745
+ path: _path + "[" + (1 + _index22) + "]",
1746
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1747
+ value: elem
1748
+ }, _errorFactory))) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1749
+ method: "assert",
1750
+ path: _path,
1751
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1752
+ value: input.slice(1)
1753
+ }, _errorFactory)); const __is = input => null !== input && undefined !== input && ("function" === typeof input || "bigint" === typeof input || (Array.isArray(input) && (_it0(input) || false) || "object" === typeof input && null !== input && _iu0(input))); let _errorFactory; return (input, errorFactory) => {
1754
+ if (false === __is(input)) {
1755
+ _errorFactory = errorFactory;
1756
+ ((input, _path, _exceptionable = true) => (null !== input || __typia_transform__assertGuard._assertGuard(true, {
1757
+ method: "assert",
1758
+ path: _path + "",
1759
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1760
+ value: input
1761
+ }, _errorFactory)) && (undefined !== input || __typia_transform__assertGuard._assertGuard(true, {
1762
+ method: "assert",
1763
+ path: _path + "",
1764
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1765
+ value: input
1766
+ }, _errorFactory)) && ("function" === typeof input || "bigint" === typeof input || (Array.isArray(input) && (_at0(input, _path + "", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1767
+ method: "assert",
1768
+ path: _path + "",
1769
+ expected: "readonly [Schema, ...Schema[]]",
1770
+ value: input
1771
+ }, _errorFactory)) || "object" === typeof input && null !== input && _au0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
1772
+ method: "assert",
1773
+ path: _path + "",
1774
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1775
+ value: input
1776
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
1777
+ method: "assert",
1778
+ path: _path + "",
1779
+ expected: "(__type | __type.o1 | __type.o10 | __type.o11 | __type.o12 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1780
+ value: input
1781
+ }, _errorFactory)))(input, "$input", true);
1782
+ }
1783
+ return input;
1784
+ }; })()(resolved[i]), value[i]));
1785
+ }
1786
+ return (result);
1787
+ }
1788
+ if (typeof resolved === 'object' && resolved !== null) {
1789
+ if ('optional' in resolved) {
1790
+ if (value === undefined) {
1791
+ return (undefined);
1792
+ }
1793
+ return (prepareValueForSchema(resolved.optional, value));
1794
+ }
1795
+ if ('sequenceOf' in resolved) {
1796
+ if (!Array.isArray(value)) {
1797
+ return (value);
1798
+ }
1799
+ return (value.map(item => prepareValueForSchema(resolved.sequenceOf, item)));
1800
+ }
1801
+ if ('choice' in resolved) {
1802
+ const choices = Array.isArray(resolved.choice)
1803
+ ? resolved.choice
1804
+ : Object.values(resolved.choice);
1805
+ for (const choiceSchema of choices) {
1806
+ const preparedChoice = prepareValueForSchema(choiceSchema, value);
1807
+ if (preparedChoice !== value) {
1808
+ return (preparedChoice);
1809
+ }
1810
+ }
1811
+ return (value);
1812
+ }
1813
+ if ('type' in resolved) {
1814
+ switch (resolved.type) {
1815
+ case 'context':
1816
+ return (prepareContextValue(resolved, value, prepareValueForSchema));
1817
+ case 'struct':
1818
+ return (prepareStructValue(resolved, value));
1819
+ default:
1820
+ return (value);
1821
+ }
1822
+ }
1823
+ }
1824
+ return (value);
1825
+ }
1826
+ export function encodeValueBySchema(schema, value, options) {
1827
+ const contextualized = contextualizeStructSchema(schema);
1828
+ try {
1829
+ const preparedUnknown = prepareValueForSchema(contextualized, value);
1830
+ // XXX:TODO Fix depth issue
1831
+ // @ts-ignore
1832
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/consistent-type-assertions
1833
+ return (ValidateASN1.againstSchema(preparedUnknown, contextualized));
1834
+ }
1835
+ catch (err) {
1836
+ const printer = options?.valuePrinter ?? defaultPrintValue;
1837
+ const prefix = options?.attributeName ? `Attribute ${options.attributeName}: ` : '';
1838
+ const message = err instanceof Error ? err.message : String(err);
1839
+ throw (new Error(`${prefix}${message} (value: ${printer(value)})`));
1840
+ }
1841
+ }
1842
+ export function normalizeDecodedASN1(input, principals) {
1843
+ if (input === undefined || input === null) {
1844
+ return (input);
1845
+ }
1846
+ if (Array.isArray(input)) {
1847
+ return (input.map(function (childInput) {
1848
+ return (normalizeDecodedASN1(childInput, principals));
1849
+ }));
1850
+ }
1851
+ if (input instanceof Date) {
1852
+ return (input);
1853
+ }
1854
+ if (Buffer.isBuffer(input) || input instanceof ArrayBuffer) {
1855
+ return (input);
1856
+ }
1857
+ if (isASN1ContextTag(input)) {
1858
+ return (normalizeDecodedASN1(input.contains, principals));
1859
+ }
1860
+ if (isASN1String(input)) {
1861
+ return (normalizeDecodedASN1(input.value, principals));
1862
+ }
1863
+ if (isASN1Date(input)) {
1864
+ return (input.date);
1865
+ }
1866
+ if (isASN1BitString(input)) {
1867
+ return (input.value);
1868
+ }
1869
+ if (isASN1Struct(input)) {
1870
+ const contains = input.contains ?? {};
1871
+ const orderedNames = Array.isArray(input.fieldNames) && input.fieldNames.length > 0
1872
+ ? input.fieldNames
1873
+ : Object.keys(contains);
1874
+ const result = {};
1875
+ for (const fieldName of orderedNames) {
1876
+ if (!Object.prototype.hasOwnProperty.call(contains, fieldName)) {
1877
+ continue;
1878
+ }
1879
+ const fieldValue = contains[fieldName];
1880
+ if (fieldValue !== undefined) {
1881
+ result[fieldName] = normalizeDecodedASN1(fieldValue, principals);
1882
+ }
1883
+ }
1884
+ if (isReferenceSchema(input)) {
1885
+ const url = input.contains.external.contains.url.value;
1886
+ const mimeType = input.contains.external.contains.contentType.value;
1887
+ const encryptionAlgoOID = input.contains.encryptionAlgorithm?.oid;
1888
+ const digestInfo = input.contains.digest.contains;
1889
+ let cachedValue = null;
1890
+ result['$blob'] = async function (additionalPrincipals) {
1891
+ /*
1892
+ * If we already have the cached value, return it
1893
+ */
1894
+ if (cachedValue) {
1895
+ return (cachedValue);
1896
+ }
1897
+ /*
1898
+ * Fetch the remote data
1899
+ */
1900
+ const result = await fetch(url);
1901
+ if (!result.ok) {
1902
+ throw (new Error(`Failed to fetch remote data from ${url}: ${result.status} ${result.statusText}`));
1903
+ }
1904
+ const dataBlob = await result.blob();
1905
+ let data = await dataBlob.arrayBuffer();
1906
+ /*
1907
+ * Sometimes people like to encode the data
1908
+ * in a JSON base64 string, check to see if
1909
+ * that's the case -- hopefully this doesn't
1910
+ * conflict with any legitimate use case
1911
+ */
1912
+ if (dataBlob.type === 'application/json') {
1913
+ try {
1914
+ const asJSON = JSON.parse(Buffer.from(data).toString('utf-8'));
1915
+ if (isPlainObject(asJSON)) {
1916
+ if (Object.keys(asJSON).length === 2) {
1917
+ if ('data' in asJSON && typeof asJSON.data === 'string' && 'mimeType' in asJSON && typeof asJSON.mimeType === 'string') {
1918
+ data = bufferToArrayBuffer(Buffer.from(asJSON.data, 'base64'));
1919
+ }
1920
+ }
1921
+ }
1922
+ }
1923
+ catch {
1924
+ /* Ignored */
1925
+ }
1926
+ }
1927
+ /*
1928
+ * Decrypt the data, if encrypted
1929
+ */
1930
+ if (encryptionAlgoOID) {
1931
+ switch (encryptionAlgoOID) {
1932
+ case '1.3.6.1.4.1.62675.2':
1933
+ case 'KeetaEncryptedContainerV1': {
1934
+ const container = EncryptedContainer.fromEncryptedBuffer(data, [
1935
+ ...principals,
1936
+ ...(additionalPrincipals ?? [])
1937
+ ]);
1938
+ data = await container.getPlaintext();
1939
+ break;
1940
+ }
1941
+ default:
1942
+ throw (new Error(`Unsupported encryption algorithm OID: ${encryptionAlgoOID}`));
1943
+ }
1944
+ }
1945
+ /*
1946
+ * Compute and verify the hash (of the plain text)
1947
+ */
1948
+ if (!Buffer.isBuffer(digestInfo.digest)) {
1949
+ throw (new TypeError('Digest value is not a buffer'));
1950
+ }
1951
+ const validHash = await checkHashWithOID(data, {
1952
+ digest: digestInfo.digest,
1953
+ digestAlgorithm: digestInfo.digestAlgorithm
1954
+ });
1955
+ if (validHash !== true) {
1956
+ throw (validHash);
1957
+ }
1958
+ const blob = new Blob([data], { type: mimeType });
1959
+ cachedValue = blob;
1960
+ return (blob);
1961
+ };
1962
+ }
1963
+ return (result);
1964
+ }
1965
+ if (isASN1Set(input)) {
1966
+ return ({
1967
+ name: normalizeDecodedASN1(input.name, principals),
1968
+ value: normalizeDecodedASN1(input.value, principals)
1969
+ });
1970
+ }
1971
+ if (isPlainObject(input)) {
1972
+ const result = {};
1973
+ for (const [key, value] of Object.entries(input)) {
1974
+ result[key] = normalizeDecodedASN1(value, principals);
1975
+ }
1976
+ return (result);
1977
+ }
1978
+ return (input);
1979
+ }
7
1980
  export { ASN1toJS, JStoASN1, BufferStorageASN1, ValidateASN1 };
8
1981
  //# sourceMappingURL=asn1.js.map