@keetanetwork/anchor 0.0.13 → 0.0.15

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 (87) hide show
  1. package/lib/certificates.d.ts +83 -21
  2. package/lib/certificates.d.ts.map +1 -1
  3. package/lib/certificates.generated.d.ts +3 -0
  4. package/lib/certificates.generated.d.ts.map +1 -0
  5. package/lib/certificates.generated.js +120 -0
  6. package/lib/certificates.generated.js.map +1 -0
  7. package/lib/certificates.js +508 -117
  8. package/lib/certificates.js.map +1 -1
  9. package/lib/http-server.d.ts +2 -1
  10. package/lib/http-server.d.ts.map +1 -1
  11. package/lib/http-server.js +5 -5
  12. package/lib/http-server.js.map +1 -1
  13. package/lib/log/index.d.ts +6 -57
  14. package/lib/log/index.d.ts.map +1 -1
  15. package/lib/log/index.js +5 -205
  16. package/lib/log/index.js.map +1 -1
  17. package/lib/log/target_console.d.ts +3 -11
  18. package/lib/log/target_console.d.ts.map +1 -1
  19. package/lib/log/target_console.js +3 -42
  20. package/lib/log/target_console.js.map +1 -1
  21. package/lib/resolver.d.ts +2 -1
  22. package/lib/resolver.d.ts.map +1 -1
  23. package/lib/resolver.js +22 -22
  24. package/lib/resolver.js.map +1 -1
  25. package/lib/utils/asn1.d.ts +10 -1
  26. package/lib/utils/asn1.d.ts.map +1 -1
  27. package/lib/utils/asn1.js +1413 -0
  28. package/lib/utils/asn1.js.map +1 -1
  29. package/lib/utils/buffer.d.ts +3 -0
  30. package/lib/utils/buffer.d.ts.map +1 -1
  31. package/lib/utils/buffer.js +32 -0
  32. package/lib/utils/buffer.js.map +1 -1
  33. package/lib/utils/external.d.ts +43 -0
  34. package/lib/utils/external.d.ts.map +1 -0
  35. package/lib/utils/external.js +115 -0
  36. package/lib/utils/external.js.map +1 -0
  37. package/lib/utils/guards.d.ts +14 -0
  38. package/lib/utils/guards.d.ts.map +1 -0
  39. package/lib/utils/guards.js +31 -0
  40. package/lib/utils/guards.js.map +1 -0
  41. package/lib/utils/index.d.ts +3 -1
  42. package/lib/utils/index.d.ts.map +1 -1
  43. package/lib/utils/index.js +3 -1
  44. package/lib/utils/index.js.map +1 -1
  45. package/lib/utils/oid.d.ts +7 -0
  46. package/lib/utils/oid.d.ts.map +1 -0
  47. package/lib/utils/oid.js +22 -0
  48. package/lib/utils/oid.js.map +1 -0
  49. package/lib/utils/signing.d.ts.map +1 -1
  50. package/lib/utils/signing.js +26 -2
  51. package/lib/utils/signing.js.map +1 -1
  52. package/npm-shrinkwrap.json +76 -216
  53. package/package.json +2 -2
  54. package/services/asset-movement/common.js +7 -7
  55. package/services/fx/server.js +1 -1
  56. package/services/fx/server.js.map +1 -1
  57. package/services/kyc/client.d.ts.map +1 -1
  58. package/services/kyc/client.js +1 -8
  59. package/services/kyc/client.js.map +1 -1
  60. package/services/kyc/common.d.ts +39 -3
  61. package/services/kyc/common.d.ts.map +1 -1
  62. package/services/kyc/common.generated.d.ts +5 -0
  63. package/services/kyc/common.generated.d.ts.map +1 -0
  64. package/services/kyc/common.generated.js +241 -0
  65. package/services/kyc/common.generated.js.map +1 -0
  66. package/services/kyc/common.js +68 -1
  67. package/services/kyc/common.js.map +1 -1
  68. package/services/kyc/iso20022.generated.d.ts +336 -0
  69. package/services/kyc/iso20022.generated.d.ts.map +1 -0
  70. package/services/kyc/iso20022.generated.js +287 -0
  71. package/services/kyc/iso20022.generated.js.map +1 -0
  72. package/services/kyc/oids.generated.d.ts +104 -0
  73. package/services/kyc/oids.generated.d.ts.map +1 -0
  74. package/services/kyc/oids.generated.js +163 -0
  75. package/services/kyc/oids.generated.js.map +1 -0
  76. package/services/kyc/server.d.ts +141 -0
  77. package/services/kyc/server.d.ts.map +1 -0
  78. package/services/kyc/server.js +183 -0
  79. package/services/kyc/server.js.map +1 -0
  80. package/services/kyc/utils/generate-kyc-schema.d.ts +3 -0
  81. package/services/kyc/utils/generate-kyc-schema.d.ts.map +1 -0
  82. package/services/kyc/utils/generate-kyc-schema.js +1342 -0
  83. package/services/kyc/utils/generate-kyc-schema.js.map +1 -0
  84. package/lib/log/common.d.ts +0 -35
  85. package/lib/log/common.d.ts.map +0 -1
  86. package/lib/log/common.js +0 -19
  87. package/lib/log/common.js.map +0 -1
package/lib/utils/asn1.js CHANGED
@@ -1,8 +1,1421 @@
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 { Buffer } from './buffer.js';
5
+ import { assert, createAssert, createIs } from 'typia';
2
6
  const ASN1 = KeetaNetLib.Utils.ASN1;
3
7
  const ASN1toJS = ASN1.ASN1toJS;
4
8
  const JStoASN1 = ASN1.JStoASN1;
5
9
  const BufferStorageASN1 = ASN1.BufferStorageASN1;
6
10
  const ValidateASN1 = ASN1.ValidateASN1;
11
+ const ASN1CheckUtilities = ASN1.ASN1CheckUtilities;
12
+ const { isASN1ContextTag, isASN1Struct, isASN1String, isASN1Date, isASN1BitString, isASN1Set } = ASN1CheckUtilities;
13
+ const assertStructFieldSchemaMap = (() => { const _ip0 = input => {
14
+ const array = input;
15
+ const top = input[0];
16
+ if (0 === input.length)
17
+ return true;
18
+ const arrayPredicators = [
19
+ [
20
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
21
+ 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))))
22
+ ],
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
+ const passed = arrayPredicators.filter(pred => pred[0](top));
29
+ if (1 === passed.length)
30
+ return passed[0][1](array);
31
+ else if (1 < passed.length)
32
+ for (const pred of passed)
33
+ if (array.every(value => true === pred[0](value)))
34
+ return pred[1](array);
35
+ return false;
36
+ }; const _ap1 = (input, _path, _exceptionable = true) => {
37
+ const array = input;
38
+ const top = input[0];
39
+ if (0 === input.length)
40
+ return true;
41
+ const arrayPredicators = [
42
+ [
43
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
44
+ method: "createAssert",
45
+ path: _path,
46
+ expected: "readonly [Schema, ...Schema[]]",
47
+ value: top
48
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
49
+ entire => entire.every((elem, _index9) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
50
+ method: "createAssert",
51
+ path: _path + "[" + _index9 + "]",
52
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
53
+ value: elem
54
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
55
+ method: "createAssert",
56
+ path: _path + "[" + _index9 + "]",
57
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
58
+ value: elem
59
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index9 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
60
+ method: "createAssert",
61
+ path: _path + "[" + _index9 + "]",
62
+ expected: "readonly [Schema, ...Schema[]]",
63
+ value: elem
64
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index9 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
65
+ method: "createAssert",
66
+ path: _path + "[" + _index9 + "]",
67
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
68
+ value: elem
69
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
70
+ method: "createAssert",
71
+ path: _path + "[" + _index9 + "]",
72
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
73
+ value: elem
74
+ }, _errorFactory)))
75
+ ],
76
+ [
77
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
78
+ method: "createAssert",
79
+ path: _path,
80
+ expected: "readonly [Schema, ...Schema[]]",
81
+ value: top
82
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
83
+ entire => entire.every((elem, _index10) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
84
+ method: "createAssert",
85
+ path: _path + "[" + _index10 + "]",
86
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
87
+ value: elem
88
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
89
+ method: "createAssert",
90
+ path: _path + "[" + _index10 + "]",
91
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
92
+ value: elem
93
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
94
+ method: "createAssert",
95
+ path: _path + "[" + _index10 + "]",
96
+ expected: "readonly [Schema, ...Schema[]]",
97
+ value: elem
98
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
99
+ method: "createAssert",
100
+ path: _path + "[" + _index10 + "]",
101
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
102
+ value: elem
103
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
104
+ method: "createAssert",
105
+ path: _path + "[" + _index10 + "]",
106
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
107
+ value: elem
108
+ }, _errorFactory)))
109
+ ]
110
+ ];
111
+ const passed = arrayPredicators.filter(pred => pred[0](top));
112
+ if (1 === passed.length)
113
+ return passed[0][1](array);
114
+ else if (1 < passed.length)
115
+ for (const pred of passed)
116
+ if (array.every(value => true === pred[0](value)))
117
+ return pred[1](array);
118
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
119
+ method: "createAssert",
120
+ path: _path,
121
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
122
+ value: input
123
+ }, _errorFactory);
124
+ }; const _io0 = input => Object.keys(input).every(key => {
125
+ const value = input[key];
126
+ if (undefined === value)
127
+ return true;
128
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu1(value)));
129
+ }); const _io1 = input => Array.isArray(input.choice) && (_ip0(input.choice) || false); const _io2 = 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 _io3 = 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 _io4 = 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 _io5 = input => "oid" === input.type && "string" === typeof input.oid; const _io6 = input => "string" === input.type && "printable" === input.kind; const _io7 = input => "string" === input.type && "ia5" === input.kind; const _io8 = input => "string" === input.type && "utf8" === input.kind; const _io9 = input => "date" === input.type && "utc" === input.kind; const _io10 = input => "date" === input.type && "general" === input.kind; const _io11 = input => "struct" === input.type && (Array.isArray(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && ("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) && _io12(input.contains)); const _io12 = input => Object.keys(input).every(key => {
130
+ const value = input[key];
131
+ if (undefined === value)
132
+ return true;
133
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
134
+ }); const _io13 = 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 => (() => {
135
+ if (undefined !== input.choice)
136
+ return _io1(input);
137
+ else if (undefined !== input.sequenceOf)
138
+ return _io2(input);
139
+ else if (undefined !== input.optional)
140
+ return _io3(input);
141
+ else if ("context" === input.type)
142
+ return _io4(input);
143
+ else if ("oid" === input.type)
144
+ return _io5(input);
145
+ else if ("general" === input.kind)
146
+ return _io10(input);
147
+ else if ("utc" === input.kind)
148
+ return _io9(input);
149
+ else if ("utf8" === input.kind)
150
+ return _io8(input);
151
+ else if ("ia5" === input.kind)
152
+ return _io7(input);
153
+ else if ("printable" === input.kind)
154
+ return _io6(input);
155
+ else if ("struct" === input.type)
156
+ return _io11(input);
157
+ else
158
+ return false;
159
+ })(); const _iu1 = input => (() => {
160
+ if (undefined !== input.choice)
161
+ return _io1(input);
162
+ else if (undefined !== input.sequenceOf)
163
+ return _io2(input);
164
+ else if ("context" === input.type)
165
+ return _io4(input);
166
+ else if ("oid" === input.type)
167
+ return _io5(input);
168
+ else if ("general" === input.kind)
169
+ return _io10(input);
170
+ else if ("utc" === input.kind)
171
+ return _io9(input);
172
+ else if ("utf8" === input.kind)
173
+ return _io8(input);
174
+ else if ("ia5" === input.kind)
175
+ return _io7(input);
176
+ else if ("printable" === input.kind)
177
+ return _io6(input);
178
+ else if ("struct" === input.type)
179
+ return _io11(input);
180
+ else
181
+ return (() => {
182
+ if (_io3(input))
183
+ return _io3(input);
184
+ if (_io13(input))
185
+ return _io13(input);
186
+ return false;
187
+ })();
188
+ })(); 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 => {
189
+ const value = input[key];
190
+ if (undefined === value)
191
+ return true;
192
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
193
+ method: "createAssert",
194
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
195
+ expected: "(__type | __type.o1 | __type.o10 | __type.o12 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
196
+ value: value
197
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
198
+ method: "createAssert",
199
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
200
+ expected: "(__type | __type.o1 | __type.o10 | __type.o12 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
201
+ value: value
202
+ }, _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, {
203
+ method: "createAssert",
204
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
205
+ expected: "readonly [Schema, ...Schema[]]",
206
+ value: value
207
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au1(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
208
+ method: "createAssert",
209
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
210
+ expected: "(__type | __type.o1 | __type.o10 | __type.o12 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
211
+ value: value
212
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
213
+ method: "createAssert",
214
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
215
+ expected: "(__type | __type.o1 | __type.o10 | __type.o12 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
216
+ value: value
217
+ }, _errorFactory));
218
+ }); const _ao1 = (input, _path, _exceptionable = true) => (Array.isArray(input.choice) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
219
+ method: "createAssert",
220
+ path: _path + ".choice",
221
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
222
+ value: input.choice
223
+ }, _errorFactory)) && (_ap1(input.choice, _path + ".choice", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
224
+ method: "createAssert",
225
+ path: _path + ".choice",
226
+ expected: "Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>",
227
+ value: input.choice
228
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
229
+ method: "createAssert",
230
+ path: _path + ".choice",
231
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
232
+ value: input.choice
233
+ }, _errorFactory); const _ao2 = (input, _path, _exceptionable = true) => (null !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
234
+ method: "createAssert",
235
+ path: _path + ".sequenceOf",
236
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
237
+ value: input.sequenceOf
238
+ }, _errorFactory)) && (undefined !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
239
+ method: "createAssert",
240
+ path: _path + ".sequenceOf",
241
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
242
+ value: input.sequenceOf
243
+ }, _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, {
244
+ method: "createAssert",
245
+ path: _path + ".sequenceOf",
246
+ expected: "readonly [Schema, ...Schema[]]",
247
+ value: input.sequenceOf
248
+ }, _errorFactory)) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _au0(input.sequenceOf, _path + ".sequenceOf", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
249
+ method: "createAssert",
250
+ path: _path + ".sequenceOf",
251
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
252
+ value: input.sequenceOf
253
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
254
+ method: "createAssert",
255
+ path: _path + ".sequenceOf",
256
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
257
+ value: input.sequenceOf
258
+ }, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => (null !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
259
+ method: "createAssert",
260
+ path: _path + ".optional",
261
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
262
+ value: input.optional
263
+ }, _errorFactory)) && (undefined !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
264
+ method: "createAssert",
265
+ path: _path + ".optional",
266
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
267
+ value: input.optional
268
+ }, _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, {
269
+ method: "createAssert",
270
+ path: _path + ".optional",
271
+ expected: "readonly [Schema, ...Schema[]]",
272
+ value: input.optional
273
+ }, _errorFactory)) || "object" === typeof input.optional && null !== input.optional && _au0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
274
+ method: "createAssert",
275
+ path: _path + ".optional",
276
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
277
+ value: input.optional
278
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
279
+ method: "createAssert",
280
+ path: _path + ".optional",
281
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
282
+ value: input.optional
283
+ }, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => ("context" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
284
+ method: "createAssert",
285
+ path: _path + ".type",
286
+ expected: "\"context\"",
287
+ value: input.type
288
+ }, _errorFactory)) && ("implicit" === input.kind || "explicit" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
289
+ method: "createAssert",
290
+ path: _path + ".kind",
291
+ expected: "(\"explicit\" | \"implicit\")",
292
+ value: input.kind
293
+ }, _errorFactory)) && ((null !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
294
+ method: "createAssert",
295
+ path: _path + ".contains",
296
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
297
+ value: input.contains
298
+ }, _errorFactory)) && (undefined !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
299
+ method: "createAssert",
300
+ path: _path + ".contains",
301
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
302
+ value: input.contains
303
+ }, _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, {
304
+ method: "createAssert",
305
+ path: _path + ".contains",
306
+ expected: "readonly [Schema, ...Schema[]]",
307
+ value: input.contains
308
+ }, _errorFactory)) || "object" === typeof input.contains && null !== input.contains && _au0(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
309
+ method: "createAssert",
310
+ path: _path + ".contains",
311
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
312
+ value: input.contains
313
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
314
+ method: "createAssert",
315
+ path: _path + ".contains",
316
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
317
+ value: input.contains
318
+ }, _errorFactory))) && ("number" === typeof input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
319
+ method: "createAssert",
320
+ path: _path + ".value",
321
+ expected: "number",
322
+ value: input.value
323
+ }, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("oid" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
324
+ method: "createAssert",
325
+ path: _path + ".type",
326
+ expected: "\"oid\"",
327
+ value: input.type
328
+ }, _errorFactory)) && ("string" === typeof input.oid || __typia_transform__assertGuard._assertGuard(_exceptionable, {
329
+ method: "createAssert",
330
+ path: _path + ".oid",
331
+ expected: "string",
332
+ value: input.oid
333
+ }, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
334
+ method: "createAssert",
335
+ path: _path + ".type",
336
+ expected: "\"string\"",
337
+ value: input.type
338
+ }, _errorFactory)) && ("printable" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
339
+ method: "createAssert",
340
+ path: _path + ".kind",
341
+ expected: "\"printable\"",
342
+ value: input.kind
343
+ }, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
344
+ method: "createAssert",
345
+ path: _path + ".type",
346
+ expected: "\"string\"",
347
+ value: input.type
348
+ }, _errorFactory)) && ("ia5" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
349
+ method: "createAssert",
350
+ path: _path + ".kind",
351
+ expected: "\"ia5\"",
352
+ value: input.kind
353
+ }, _errorFactory)); const _ao8 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
354
+ method: "createAssert",
355
+ path: _path + ".type",
356
+ expected: "\"string\"",
357
+ value: input.type
358
+ }, _errorFactory)) && ("utf8" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
359
+ method: "createAssert",
360
+ path: _path + ".kind",
361
+ expected: "\"utf8\"",
362
+ value: input.kind
363
+ }, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
364
+ method: "createAssert",
365
+ path: _path + ".type",
366
+ expected: "\"date\"",
367
+ value: input.type
368
+ }, _errorFactory)) && ("utc" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
369
+ method: "createAssert",
370
+ path: _path + ".kind",
371
+ expected: "\"utc\"",
372
+ value: input.kind
373
+ }, _errorFactory)); const _ao10 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
374
+ method: "createAssert",
375
+ path: _path + ".type",
376
+ expected: "\"date\"",
377
+ value: input.type
378
+ }, _errorFactory)) && ("general" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
379
+ method: "createAssert",
380
+ path: _path + ".kind",
381
+ expected: "\"general\"",
382
+ value: input.kind
383
+ }, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => ("struct" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
384
+ method: "createAssert",
385
+ path: _path + ".type",
386
+ expected: "\"struct\"",
387
+ value: input.type
388
+ }, _errorFactory)) && ((Array.isArray(input.fieldNames) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
389
+ method: "createAssert",
390
+ path: _path + ".fieldNames",
391
+ expected: "Array<string>",
392
+ value: input.fieldNames
393
+ }, _errorFactory)) && input.fieldNames.every((elem, _index11) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
394
+ method: "createAssert",
395
+ path: _path + ".fieldNames[" + _index11 + "]",
396
+ expected: "string",
397
+ value: elem
398
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
399
+ method: "createAssert",
400
+ path: _path + ".fieldNames",
401
+ expected: "Array<string>",
402
+ value: input.fieldNames
403
+ }, _errorFactory)) && (("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
404
+ method: "createAssert",
405
+ path: _path + ".contains",
406
+ expected: "__type.o11",
407
+ value: input.contains
408
+ }, _errorFactory)) && _ao12(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
409
+ method: "createAssert",
410
+ path: _path + ".contains",
411
+ expected: "__type.o11",
412
+ value: input.contains
413
+ }, _errorFactory)); const _ao12 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
414
+ const value = input[key];
415
+ if (undefined === value)
416
+ return true;
417
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
418
+ method: "createAssert",
419
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
420
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
421
+ value: value
422
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
423
+ method: "createAssert",
424
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
425
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
426
+ value: value
427
+ }, _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, {
428
+ method: "createAssert",
429
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
430
+ expected: "readonly [Schema, ...Schema[]]",
431
+ value: value
432
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
433
+ method: "createAssert",
434
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
435
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
436
+ value: value
437
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
438
+ method: "createAssert",
439
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
440
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
441
+ value: value
442
+ }, _errorFactory));
443
+ }); const _ao13 = (input, _path, _exceptionable = true) => (null !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
444
+ method: "createAssert",
445
+ path: _path + ".optional",
446
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
447
+ value: input.optional
448
+ }, _errorFactory)) && (undefined !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
449
+ method: "createAssert",
450
+ path: _path + ".optional",
451
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
452
+ value: input.optional
453
+ }, _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, {
454
+ method: "createAssert",
455
+ path: _path + ".optional",
456
+ expected: "readonly [Schema, ...Schema[]]",
457
+ value: input.optional
458
+ }, _errorFactory)) || "object" === typeof input.optional && null !== input.optional && _au0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
459
+ method: "createAssert",
460
+ path: _path + ".optional",
461
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
462
+ value: input.optional
463
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
464
+ method: "createAssert",
465
+ path: _path + ".optional",
466
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
467
+ value: input.optional
468
+ }, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
469
+ if (undefined !== input.choice)
470
+ return _ao1(input, _path, true && _exceptionable);
471
+ else if (undefined !== input.sequenceOf)
472
+ return _ao2(input, _path, true && _exceptionable);
473
+ else if (undefined !== input.optional)
474
+ return _ao3(input, _path, true && _exceptionable);
475
+ else if ("context" === input.type)
476
+ return _ao4(input, _path, true && _exceptionable);
477
+ else if ("oid" === input.type)
478
+ return _ao5(input, _path, true && _exceptionable);
479
+ else if ("general" === input.kind)
480
+ return _ao10(input, _path, true && _exceptionable);
481
+ else if ("utc" === input.kind)
482
+ return _ao9(input, _path, true && _exceptionable);
483
+ else if ("utf8" === input.kind)
484
+ return _ao8(input, _path, true && _exceptionable);
485
+ else if ("ia5" === input.kind)
486
+ return _ao7(input, _path, true && _exceptionable);
487
+ else if ("printable" === input.kind)
488
+ return _ao6(input, _path, true && _exceptionable);
489
+ else if ("struct" === input.type)
490
+ return _ao11(input, _path, true && _exceptionable);
491
+ else
492
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
493
+ method: "createAssert",
494
+ path: _path,
495
+ expected: "(__type | __type.o1 | __type.o2 | __type.o3 | __type.o4 | __type.o9 | __type.o8 | __type.o7 | __type.o6 | __type.o5 | __type.o10)",
496
+ value: input
497
+ }, _errorFactory);
498
+ })(); const _au1 = (input, _path, _exceptionable = true) => (() => {
499
+ if (undefined !== input.choice)
500
+ return _ao1(input, _path, true && _exceptionable);
501
+ else if (undefined !== input.sequenceOf)
502
+ return _ao2(input, _path, true && _exceptionable);
503
+ else if ("context" === input.type)
504
+ return _ao4(input, _path, true && _exceptionable);
505
+ else if ("oid" === input.type)
506
+ return _ao5(input, _path, true && _exceptionable);
507
+ else if ("general" === input.kind)
508
+ return _ao10(input, _path, true && _exceptionable);
509
+ else if ("utc" === input.kind)
510
+ return _ao9(input, _path, true && _exceptionable);
511
+ else if ("utf8" === input.kind)
512
+ return _ao8(input, _path, true && _exceptionable);
513
+ else if ("ia5" === input.kind)
514
+ return _ao7(input, _path, true && _exceptionable);
515
+ else if ("printable" === input.kind)
516
+ return _ao6(input, _path, true && _exceptionable);
517
+ else if ("struct" === input.type)
518
+ return _ao11(input, _path, true && _exceptionable);
519
+ else
520
+ return _ao3(input, _path, false && _exceptionable) || _ao13(input, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
521
+ method: "createAssert",
522
+ path: _path,
523
+ expected: "(__type.o2 | __type.o12)",
524
+ value: input
525
+ }, _errorFactory);
526
+ })(); const _at0 = (input, _path, _exceptionable = true) => (null !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
527
+ method: "createAssert",
528
+ path: _path + "[0]",
529
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
530
+ value: input[0]
531
+ }, _errorFactory)) && (undefined !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
532
+ method: "createAssert",
533
+ path: _path + "[0]",
534
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
535
+ value: input[0]
536
+ }, _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, {
537
+ method: "createAssert",
538
+ path: _path + "[0]",
539
+ expected: "readonly [Schema, ...Schema[]]",
540
+ value: input[0]
541
+ }, _errorFactory)) || "object" === typeof input[0] && null !== input[0] && _au0(input[0], _path + "[0]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
542
+ method: "createAssert",
543
+ path: _path + "[0]",
544
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
545
+ value: input[0]
546
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
547
+ method: "createAssert",
548
+ path: _path + "[0]",
549
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
550
+ value: input[0]
551
+ }, _errorFactory)) && ((Array.isArray(input.slice(1)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
552
+ method: "createAssert",
553
+ path: _path,
554
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
555
+ value: input.slice(1)
556
+ }, _errorFactory)) && input.slice(1).every((elem, _index12) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
557
+ method: "createAssert",
558
+ path: _path + "[" + (1 + _index12) + "]",
559
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
560
+ value: elem
561
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
562
+ method: "createAssert",
563
+ path: _path + "[" + (1 + _index12) + "]",
564
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
565
+ value: elem
566
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + (1 + _index12) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
567
+ method: "createAssert",
568
+ path: _path + "[" + (1 + _index12) + "]",
569
+ expected: "readonly [Schema, ...Schema[]]",
570
+ value: elem
571
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + (1 + _index12) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
572
+ method: "createAssert",
573
+ path: _path + "[" + (1 + _index12) + "]",
574
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
575
+ value: elem
576
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
577
+ method: "createAssert",
578
+ path: _path + "[" + (1 + _index12) + "]",
579
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
580
+ value: elem
581
+ }, _errorFactory))) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
582
+ method: "createAssert",
583
+ path: _path,
584
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
585
+ value: input.slice(1)
586
+ }, _errorFactory)); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); let _errorFactory; return (input, errorFactory) => {
587
+ if (false === __is(input)) {
588
+ _errorFactory = errorFactory;
589
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
590
+ method: "createAssert",
591
+ path: _path + "",
592
+ expected: "StructFieldSchemaMap",
593
+ value: input
594
+ }, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
595
+ method: "createAssert",
596
+ path: _path + "",
597
+ expected: "StructFieldSchemaMap",
598
+ value: input
599
+ }, _errorFactory))(input, "$input", true);
600
+ }
601
+ return input;
602
+ }; })();
603
+ const structSchemaGuard = (() => { const _ip0 = input => {
604
+ const array = input;
605
+ const top = input[0];
606
+ if (0 === input.length)
607
+ return true;
608
+ const arrayPredicators = [
609
+ [
610
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
611
+ 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))))
612
+ ],
613
+ [
614
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
615
+ 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))))
616
+ ]
617
+ ];
618
+ const passed = arrayPredicators.filter(pred => pred[0](top));
619
+ if (1 === passed.length)
620
+ return passed[0][1](array);
621
+ else if (1 < passed.length)
622
+ for (const pred of passed)
623
+ if (array.every(value => true === pred[0](value)))
624
+ return pred[1](array);
625
+ return false;
626
+ }; const _io0 = input => "struct" === input.type && (Array.isArray(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && ("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) && _io1(input.contains)); const _io1 = input => Object.keys(input).every(key => {
627
+ const value = input[key];
628
+ if (undefined === value)
629
+ return true;
630
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
631
+ }); const _io2 = input => Array.isArray(input.choice) && (_ip0(input.choice) || false); 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 _iu0 = input => (() => {
632
+ if (undefined !== input.choice)
633
+ return _io2(input);
634
+ else if (undefined !== input.sequenceOf)
635
+ return _io3(input);
636
+ else if (undefined !== input.optional)
637
+ return _io4(input);
638
+ else if ("context" === input.type)
639
+ return _io5(input);
640
+ else if ("oid" === input.type)
641
+ return _io6(input);
642
+ else if ("general" === input.kind)
643
+ return _io11(input);
644
+ else if ("utc" === input.kind)
645
+ return _io10(input);
646
+ else if ("utf8" === input.kind)
647
+ return _io9(input);
648
+ else if ("ia5" === input.kind)
649
+ return _io8(input);
650
+ else if ("printable" === input.kind)
651
+ return _io7(input);
652
+ else if ("struct" === input.type)
653
+ return _io0(input);
654
+ else
655
+ return false;
656
+ })(); 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); })();
657
+ const structSchemaCache = new WeakMap();
658
+ function defaultPrintValue(value) {
659
+ try {
660
+ return (JSON.stringify(value));
661
+ }
662
+ catch {
663
+ return (String(value));
664
+ }
665
+ }
666
+ function isOptionalSchema(candidate) {
667
+ return (typeof candidate === 'object' && candidate !== null && 'optional' in candidate);
668
+ }
669
+ function isStructSchema(candidate) {
670
+ return (structSchemaGuard(candidate));
671
+ }
672
+ function ensureStructContains(schema) {
673
+ if (!schema.contains) {
674
+ return ({});
675
+ }
676
+ return (assertStructFieldSchemaMap(schema.contains));
677
+ }
678
+ function isPlainObject(value) {
679
+ return (typeof value === 'object' && value !== null && !Array.isArray(value));
680
+ }
681
+ function getFieldNames(schema) {
682
+ return (Array.isArray(schema.fieldNames) && schema.fieldNames.length > 0
683
+ ? [...schema.fieldNames]
684
+ : Object.keys(ensureStructContains(schema)));
685
+ }
686
+ export function contextualizeStructSchema(schema) {
687
+ if (!isStructSchema(schema)) {
688
+ return (schema);
689
+ }
690
+ const cached = structSchemaCache.get(schema);
691
+ if (cached) {
692
+ return (cached);
693
+ }
694
+ const fieldNames = getFieldNames(schema);
695
+ const structContains = ensureStructContains(schema);
696
+ const contextualizedContains = {};
697
+ function wrapWithExplicitContext(index, innerSchema) {
698
+ if (typeof innerSchema === 'object' && innerSchema !== null && 'type' in innerSchema && innerSchema.type === 'context') {
699
+ return (innerSchema);
700
+ }
701
+ return ({
702
+ type: 'context',
703
+ kind: 'explicit',
704
+ value: index,
705
+ contains: contextualizeStructSchema(innerSchema)
706
+ });
707
+ }
708
+ for (const [index, fieldName] of fieldNames.entries()) {
709
+ const fieldSchema = structContains[fieldName];
710
+ if (!fieldSchema) {
711
+ continue;
712
+ }
713
+ if (isOptionalSchema(fieldSchema)) {
714
+ contextualizedContains[fieldName] = {
715
+ optional: wrapWithExplicitContext(index, fieldSchema.optional)
716
+ };
717
+ continue;
718
+ }
719
+ contextualizedContains[fieldName] = wrapWithExplicitContext(index, fieldSchema);
720
+ }
721
+ const contextualized = {
722
+ type: 'struct',
723
+ fieldNames,
724
+ contains: contextualizedContains
725
+ };
726
+ structSchemaCache.set(schema, contextualized);
727
+ return (contextualized);
728
+ }
729
+ function resolveSchema(schema) {
730
+ let current = schema;
731
+ while (typeof current === 'function') {
732
+ current = current();
733
+ }
734
+ return (current);
735
+ }
736
+ function prepareContextValue(schema, value, prepare) {
737
+ if (value === undefined) {
738
+ return (value);
739
+ }
740
+ if (isASN1ContextTag(value)) {
741
+ const preparedContains = prepare(schema.contains, value.contains);
742
+ if (preparedContains !== value.contains) {
743
+ return ({
744
+ type: 'context',
745
+ kind: value.kind,
746
+ value: value.value,
747
+ contains: preparedContains
748
+ });
749
+ }
750
+ return (value);
751
+ }
752
+ const contains = prepare(schema.contains, value);
753
+ return ({
754
+ type: 'context',
755
+ kind: schema.kind,
756
+ value: schema.value,
757
+ contains
758
+ });
759
+ }
760
+ function prepareStructValue(schema, value) {
761
+ const structContains = schema.contains ?? {};
762
+ const fieldNames = getFieldNames(schema);
763
+ if (isASN1Struct(value)) {
764
+ const preparedContains = {};
765
+ for (const [fieldName, fieldValue] of Object.entries(value.contains ?? {})) {
766
+ const fieldSchema = structContains[fieldName];
767
+ if (!fieldSchema) {
768
+ preparedContains[fieldName] = fieldValue;
769
+ continue;
770
+ }
771
+ const innerSchema = isOptionalSchema(fieldSchema) ? fieldSchema.optional : fieldSchema;
772
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
773
+ preparedContains[fieldName] = prepareValueForSchema(innerSchema, fieldValue);
774
+ }
775
+ return ({
776
+ type: 'struct',
777
+ fieldNames: value.fieldNames ?? fieldNames,
778
+ contains: preparedContains
779
+ });
780
+ }
781
+ if (!isPlainObject(value)) {
782
+ return (value);
783
+ }
784
+ const preparedContains = {};
785
+ for (const fieldName of fieldNames) {
786
+ const fieldSchema = structContains[fieldName];
787
+ if (!fieldSchema) {
788
+ continue;
789
+ }
790
+ const fieldValue = value[fieldName];
791
+ if (fieldValue === undefined) {
792
+ if (!isOptionalSchema(fieldSchema)) {
793
+ preparedContains[fieldName] = fieldValue;
794
+ }
795
+ continue;
796
+ }
797
+ const innerSchema = isOptionalSchema(fieldSchema) ? fieldSchema.optional : fieldSchema;
798
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
799
+ preparedContains[fieldName] = prepareValueForSchema(innerSchema, fieldValue);
800
+ }
801
+ return ({
802
+ type: 'struct',
803
+ fieldNames,
804
+ contains: preparedContains
805
+ });
806
+ }
807
+ function prepareValueForSchema(schema, value) {
808
+ const resolved = resolveSchema(schema);
809
+ if (value === undefined || value === null) {
810
+ return (value);
811
+ }
812
+ if (Array.isArray(resolved)) {
813
+ if (!Array.isArray(value)) {
814
+ return (value);
815
+ }
816
+ const result = [];
817
+ for (let i = 0; i < resolved.length; i++) {
818
+ result.push(prepareValueForSchema((() => { const _ip0 = input => {
819
+ const array = input;
820
+ const top = input[0];
821
+ if (0 === input.length)
822
+ return true;
823
+ const arrayPredicators = [
824
+ [
825
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
826
+ 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))))
827
+ ],
828
+ [
829
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_it0(top) || false) || "object" === typeof top && null !== top && _iu0(top))),
830
+ 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))))
831
+ ]
832
+ ];
833
+ const passed = arrayPredicators.filter(pred => pred[0](top));
834
+ if (1 === passed.length)
835
+ return passed[0][1](array);
836
+ else if (1 < passed.length)
837
+ for (const pred of passed)
838
+ if (array.every(value => true === pred[0](value)))
839
+ return pred[1](array);
840
+ return false;
841
+ }; const _ap1 = (input, _path, _exceptionable = true) => {
842
+ const array = input;
843
+ const top = input[0];
844
+ if (0 === input.length)
845
+ return true;
846
+ const arrayPredicators = [
847
+ [
848
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
849
+ method: "assert",
850
+ path: _path,
851
+ expected: "readonly [Schema, ...Schema[]]",
852
+ value: top
853
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
854
+ entire => entire.every((elem, _index9) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
855
+ method: "assert",
856
+ path: _path + "[" + _index9 + "]",
857
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
858
+ value: elem
859
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
860
+ method: "assert",
861
+ path: _path + "[" + _index9 + "]",
862
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
863
+ value: elem
864
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index9 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
865
+ method: "assert",
866
+ path: _path + "[" + _index9 + "]",
867
+ expected: "readonly [Schema, ...Schema[]]",
868
+ value: elem
869
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index9 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
870
+ method: "assert",
871
+ path: _path + "[" + _index9 + "]",
872
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
873
+ value: elem
874
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
875
+ method: "assert",
876
+ path: _path + "[" + _index9 + "]",
877
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
878
+ value: elem
879
+ }, _errorFactory)))
880
+ ],
881
+ [
882
+ top => null !== top && undefined !== top && ("function" === typeof top || "bigint" === typeof top || (Array.isArray(top) && (_at0(top, _path, false && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
883
+ method: "assert",
884
+ path: _path,
885
+ expected: "readonly [Schema, ...Schema[]]",
886
+ value: top
887
+ }, _errorFactory)) || "object" === typeof top && null !== top && _au0(top, _path, false && _exceptionable))),
888
+ entire => entire.every((elem, _index10) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
889
+ method: "assert",
890
+ path: _path + "[" + _index10 + "]",
891
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
892
+ value: elem
893
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
894
+ method: "assert",
895
+ path: _path + "[" + _index10 + "]",
896
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
897
+ value: elem
898
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
899
+ method: "assert",
900
+ path: _path + "[" + _index10 + "]",
901
+ expected: "readonly [Schema, ...Schema[]]",
902
+ value: elem
903
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
904
+ method: "assert",
905
+ path: _path + "[" + _index10 + "]",
906
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
907
+ value: elem
908
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
909
+ method: "assert",
910
+ path: _path + "[" + _index10 + "]",
911
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
912
+ value: elem
913
+ }, _errorFactory)))
914
+ ]
915
+ ];
916
+ const passed = arrayPredicators.filter(pred => pred[0](top));
917
+ if (1 === passed.length)
918
+ return passed[0][1](array);
919
+ else if (1 < passed.length)
920
+ for (const pred of passed)
921
+ if (array.every(value => true === pred[0](value)))
922
+ return pred[1](array);
923
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
924
+ method: "assert",
925
+ path: _path,
926
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
927
+ value: input
928
+ }, _errorFactory);
929
+ }; const _io0 = input => Array.isArray(input.choice) && (_ip0(input.choice) || false); const _io1 = 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 _io2 = 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 _io3 = 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 _io4 = input => "oid" === input.type && "string" === typeof input.oid; const _io5 = input => "string" === input.type && "printable" === input.kind; const _io6 = input => "string" === input.type && "ia5" === input.kind; const _io7 = input => "string" === input.type && "utf8" === input.kind; const _io8 = input => "date" === input.type && "utc" === input.kind; const _io9 = input => "date" === input.type && "general" === input.kind; const _io10 = input => "struct" === input.type && (Array.isArray(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)) && ("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) && _io11(input.contains)); const _io11 = input => Object.keys(input).every(key => {
930
+ const value = input[key];
931
+ if (undefined === value)
932
+ return true;
933
+ return null !== value && undefined !== value && ("function" === typeof value || "bigint" === typeof value || (Array.isArray(value) && (_it0(value) || false) || "object" === typeof value && null !== value && _iu0(value)));
934
+ }); const _iu0 = input => (() => {
935
+ if (undefined !== input.choice)
936
+ return _io0(input);
937
+ else if (undefined !== input.sequenceOf)
938
+ return _io1(input);
939
+ else if (undefined !== input.optional)
940
+ return _io2(input);
941
+ else if ("context" === input.type)
942
+ return _io3(input);
943
+ else if ("oid" === input.type)
944
+ return _io4(input);
945
+ else if ("general" === input.kind)
946
+ return _io9(input);
947
+ else if ("utc" === input.kind)
948
+ return _io8(input);
949
+ else if ("utf8" === input.kind)
950
+ return _io7(input);
951
+ else if ("ia5" === input.kind)
952
+ return _io6(input);
953
+ else if ("printable" === input.kind)
954
+ return _io5(input);
955
+ else if ("struct" === input.type)
956
+ return _io10(input);
957
+ else
958
+ return false;
959
+ })(); 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, {
960
+ method: "assert",
961
+ path: _path + ".choice",
962
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
963
+ value: input.choice
964
+ }, _errorFactory)) && (_ap1(input.choice, _path + ".choice", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
965
+ method: "assert",
966
+ path: _path + ".choice",
967
+ expected: "Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>",
968
+ value: input.choice
969
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
970
+ method: "assert",
971
+ path: _path + ".choice",
972
+ expected: "(Array<ValidateASN1.Schema> | ReadonlyArray<ValidateASN1.Schema>)",
973
+ value: input.choice
974
+ }, _errorFactory); const _ao1 = (input, _path, _exceptionable = true) => (null !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
975
+ method: "assert",
976
+ path: _path + ".sequenceOf",
977
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
978
+ value: input.sequenceOf
979
+ }, _errorFactory)) && (undefined !== input.sequenceOf || __typia_transform__assertGuard._assertGuard(_exceptionable, {
980
+ method: "assert",
981
+ path: _path + ".sequenceOf",
982
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
983
+ value: input.sequenceOf
984
+ }, _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, {
985
+ method: "assert",
986
+ path: _path + ".sequenceOf",
987
+ expected: "readonly [Schema, ...Schema[]]",
988
+ value: input.sequenceOf
989
+ }, _errorFactory)) || "object" === typeof input.sequenceOf && null !== input.sequenceOf && _au0(input.sequenceOf, _path + ".sequenceOf", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
990
+ method: "assert",
991
+ path: _path + ".sequenceOf",
992
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
993
+ value: input.sequenceOf
994
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
995
+ method: "assert",
996
+ path: _path + ".sequenceOf",
997
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
998
+ value: input.sequenceOf
999
+ }, _errorFactory)); const _ao2 = (input, _path, _exceptionable = true) => (null !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1000
+ method: "assert",
1001
+ path: _path + ".optional",
1002
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1003
+ value: input.optional
1004
+ }, _errorFactory)) && (undefined !== input.optional || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1005
+ method: "assert",
1006
+ path: _path + ".optional",
1007
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1008
+ value: input.optional
1009
+ }, _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, {
1010
+ method: "assert",
1011
+ path: _path + ".optional",
1012
+ expected: "readonly [Schema, ...Schema[]]",
1013
+ value: input.optional
1014
+ }, _errorFactory)) || "object" === typeof input.optional && null !== input.optional && _au0(input.optional, _path + ".optional", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1015
+ method: "assert",
1016
+ path: _path + ".optional",
1017
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1018
+ value: input.optional
1019
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1020
+ method: "assert",
1021
+ path: _path + ".optional",
1022
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1023
+ value: input.optional
1024
+ }, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => ("context" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1025
+ method: "assert",
1026
+ path: _path + ".type",
1027
+ expected: "\"context\"",
1028
+ value: input.type
1029
+ }, _errorFactory)) && ("implicit" === input.kind || "explicit" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1030
+ method: "assert",
1031
+ path: _path + ".kind",
1032
+ expected: "(\"explicit\" | \"implicit\")",
1033
+ value: input.kind
1034
+ }, _errorFactory)) && ((null !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1035
+ method: "assert",
1036
+ path: _path + ".contains",
1037
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1038
+ value: input.contains
1039
+ }, _errorFactory)) && (undefined !== input.contains || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1040
+ method: "assert",
1041
+ path: _path + ".contains",
1042
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1043
+ value: input.contains
1044
+ }, _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, {
1045
+ method: "assert",
1046
+ path: _path + ".contains",
1047
+ expected: "readonly [Schema, ...Schema[]]",
1048
+ value: input.contains
1049
+ }, _errorFactory)) || "object" === typeof input.contains && null !== input.contains && _au0(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1050
+ method: "assert",
1051
+ path: _path + ".contains",
1052
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1053
+ value: input.contains
1054
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1055
+ method: "assert",
1056
+ path: _path + ".contains",
1057
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1058
+ value: input.contains
1059
+ }, _errorFactory))) && ("number" === typeof input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1060
+ method: "assert",
1061
+ path: _path + ".value",
1062
+ expected: "number",
1063
+ value: input.value
1064
+ }, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => ("oid" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1065
+ method: "assert",
1066
+ path: _path + ".type",
1067
+ expected: "\"oid\"",
1068
+ value: input.type
1069
+ }, _errorFactory)) && ("string" === typeof input.oid || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1070
+ method: "assert",
1071
+ path: _path + ".oid",
1072
+ expected: "string",
1073
+ value: input.oid
1074
+ }, _errorFactory)); const _ao5 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1075
+ method: "assert",
1076
+ path: _path + ".type",
1077
+ expected: "\"string\"",
1078
+ value: input.type
1079
+ }, _errorFactory)) && ("printable" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1080
+ method: "assert",
1081
+ path: _path + ".kind",
1082
+ expected: "\"printable\"",
1083
+ value: input.kind
1084
+ }, _errorFactory)); const _ao6 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1085
+ method: "assert",
1086
+ path: _path + ".type",
1087
+ expected: "\"string\"",
1088
+ value: input.type
1089
+ }, _errorFactory)) && ("ia5" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1090
+ method: "assert",
1091
+ path: _path + ".kind",
1092
+ expected: "\"ia5\"",
1093
+ value: input.kind
1094
+ }, _errorFactory)); const _ao7 = (input, _path, _exceptionable = true) => ("string" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1095
+ method: "assert",
1096
+ path: _path + ".type",
1097
+ expected: "\"string\"",
1098
+ value: input.type
1099
+ }, _errorFactory)) && ("utf8" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1100
+ method: "assert",
1101
+ path: _path + ".kind",
1102
+ expected: "\"utf8\"",
1103
+ value: input.kind
1104
+ }, _errorFactory)); const _ao8 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1105
+ method: "assert",
1106
+ path: _path + ".type",
1107
+ expected: "\"date\"",
1108
+ value: input.type
1109
+ }, _errorFactory)) && ("utc" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1110
+ method: "assert",
1111
+ path: _path + ".kind",
1112
+ expected: "\"utc\"",
1113
+ value: input.kind
1114
+ }, _errorFactory)); const _ao9 = (input, _path, _exceptionable = true) => ("date" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1115
+ method: "assert",
1116
+ path: _path + ".type",
1117
+ expected: "\"date\"",
1118
+ value: input.type
1119
+ }, _errorFactory)) && ("general" === input.kind || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1120
+ method: "assert",
1121
+ path: _path + ".kind",
1122
+ expected: "\"general\"",
1123
+ value: input.kind
1124
+ }, _errorFactory)); const _ao10 = (input, _path, _exceptionable = true) => ("struct" === input.type || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1125
+ method: "assert",
1126
+ path: _path + ".type",
1127
+ expected: "\"struct\"",
1128
+ value: input.type
1129
+ }, _errorFactory)) && ((Array.isArray(input.fieldNames) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1130
+ method: "assert",
1131
+ path: _path + ".fieldNames",
1132
+ expected: "Array<string>",
1133
+ value: input.fieldNames
1134
+ }, _errorFactory)) && input.fieldNames.every((elem, _index11) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1135
+ method: "assert",
1136
+ path: _path + ".fieldNames[" + _index11 + "]",
1137
+ expected: "string",
1138
+ value: elem
1139
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1140
+ method: "assert",
1141
+ path: _path + ".fieldNames",
1142
+ expected: "Array<string>",
1143
+ value: input.fieldNames
1144
+ }, _errorFactory)) && (("object" === typeof input.contains && null !== input.contains && false === Array.isArray(input.contains) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1145
+ method: "assert",
1146
+ path: _path + ".contains",
1147
+ expected: "__type.o11",
1148
+ value: input.contains
1149
+ }, _errorFactory)) && _ao11(input.contains, _path + ".contains", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1150
+ method: "assert",
1151
+ path: _path + ".contains",
1152
+ expected: "__type.o11",
1153
+ value: input.contains
1154
+ }, _errorFactory)); const _ao11 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
1155
+ const value = input[key];
1156
+ if (undefined === value)
1157
+ return true;
1158
+ return (null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1159
+ method: "assert",
1160
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1161
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1162
+ value: value
1163
+ }, _errorFactory)) && (undefined !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1164
+ method: "assert",
1165
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1166
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1167
+ value: value
1168
+ }, _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, {
1169
+ method: "assert",
1170
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1171
+ expected: "readonly [Schema, ...Schema[]]",
1172
+ value: value
1173
+ }, _errorFactory)) || "object" === typeof value && null !== value && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1174
+ method: "assert",
1175
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1176
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1177
+ value: value
1178
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1179
+ method: "assert",
1180
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
1181
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1182
+ value: value
1183
+ }, _errorFactory));
1184
+ }); const _au0 = (input, _path, _exceptionable = true) => (() => {
1185
+ if (undefined !== input.choice)
1186
+ return _ao0(input, _path, true && _exceptionable);
1187
+ else if (undefined !== input.sequenceOf)
1188
+ return _ao1(input, _path, true && _exceptionable);
1189
+ else if (undefined !== input.optional)
1190
+ return _ao2(input, _path, true && _exceptionable);
1191
+ else if ("context" === input.type)
1192
+ return _ao3(input, _path, true && _exceptionable);
1193
+ else if ("oid" === input.type)
1194
+ return _ao4(input, _path, true && _exceptionable);
1195
+ else if ("general" === input.kind)
1196
+ return _ao9(input, _path, true && _exceptionable);
1197
+ else if ("utc" === input.kind)
1198
+ return _ao8(input, _path, true && _exceptionable);
1199
+ else if ("utf8" === input.kind)
1200
+ return _ao7(input, _path, true && _exceptionable);
1201
+ else if ("ia5" === input.kind)
1202
+ return _ao6(input, _path, true && _exceptionable);
1203
+ else if ("printable" === input.kind)
1204
+ return _ao5(input, _path, true && _exceptionable);
1205
+ else if ("struct" === input.type)
1206
+ return _ao10(input, _path, true && _exceptionable);
1207
+ else
1208
+ return __typia_transform__assertGuard._assertGuard(_exceptionable, {
1209
+ method: "assert",
1210
+ path: _path,
1211
+ expected: "(__type | __type.o1 | __type.o2 | __type.o3 | __type.o4 | __type.o9 | __type.o8 | __type.o7 | __type.o6 | __type.o5 | __type.o10)",
1212
+ value: input
1213
+ }, _errorFactory);
1214
+ })(); const _at0 = (input, _path, _exceptionable = true) => (null !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1215
+ method: "assert",
1216
+ path: _path + "[0]",
1217
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1218
+ value: input[0]
1219
+ }, _errorFactory)) && (undefined !== input[0] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1220
+ method: "assert",
1221
+ path: _path + "[0]",
1222
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1223
+ value: input[0]
1224
+ }, _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, {
1225
+ method: "assert",
1226
+ path: _path + "[0]",
1227
+ expected: "readonly [Schema, ...Schema[]]",
1228
+ value: input[0]
1229
+ }, _errorFactory)) || "object" === typeof input[0] && null !== input[0] && _au0(input[0], _path + "[0]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1230
+ method: "assert",
1231
+ path: _path + "[0]",
1232
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1233
+ value: input[0]
1234
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1235
+ method: "assert",
1236
+ path: _path + "[0]",
1237
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1238
+ value: input[0]
1239
+ }, _errorFactory)) && ((Array.isArray(input.slice(1)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1240
+ method: "assert",
1241
+ path: _path,
1242
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1243
+ value: input.slice(1)
1244
+ }, _errorFactory)) && input.slice(1).every((elem, _index12) => (null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1245
+ method: "assert",
1246
+ path: _path + "[" + (1 + _index12) + "]",
1247
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1248
+ value: elem
1249
+ }, _errorFactory)) && (undefined !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1250
+ method: "assert",
1251
+ path: _path + "[" + (1 + _index12) + "]",
1252
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1253
+ value: elem
1254
+ }, _errorFactory)) && ("function" === typeof elem || "bigint" === typeof elem || (Array.isArray(elem) && (_at0(elem, _path + "[" + (1 + _index12) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1255
+ method: "assert",
1256
+ path: _path + "[" + (1 + _index12) + "]",
1257
+ expected: "readonly [Schema, ...Schema[]]",
1258
+ value: elem
1259
+ }, _errorFactory)) || "object" === typeof elem && null !== elem && _au0(elem, _path + "[" + (1 + _index12) + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1260
+ method: "assert",
1261
+ path: _path + "[" + (1 + _index12) + "]",
1262
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1263
+ value: elem
1264
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1265
+ method: "assert",
1266
+ path: _path + "[" + (1 + _index12) + "]",
1267
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1268
+ value: elem
1269
+ }, _errorFactory))) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1270
+ method: "assert",
1271
+ path: _path,
1272
+ expected: "...(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1273
+ value: input.slice(1)
1274
+ }, _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) => {
1275
+ if (false === __is(input)) {
1276
+ _errorFactory = errorFactory;
1277
+ ((input, _path, _exceptionable = true) => (null !== input || __typia_transform__assertGuard._assertGuard(true, {
1278
+ method: "assert",
1279
+ path: _path + "",
1280
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1281
+ value: input
1282
+ }, _errorFactory)) && (undefined !== input || __typia_transform__assertGuard._assertGuard(true, {
1283
+ method: "assert",
1284
+ path: _path + "",
1285
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1286
+ value: input
1287
+ }, _errorFactory)) && ("function" === typeof input || "bigint" === typeof input || (Array.isArray(input) && (_at0(input, _path + "", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
1288
+ method: "assert",
1289
+ path: _path + "",
1290
+ expected: "readonly [Schema, ...Schema[]]",
1291
+ value: input
1292
+ }, _errorFactory)) || "object" === typeof input && null !== input && _au0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
1293
+ method: "assert",
1294
+ path: _path + "",
1295
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1296
+ value: input
1297
+ }, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
1298
+ method: "assert",
1299
+ path: _path + "",
1300
+ expected: "(__type | __type.o1 | __type.o10 | __type.o2 | __type.o3 | __type.o4 | __type.o5 | __type.o6 | __type.o7 | __type.o8 | __type.o9 | bigint | readonly [Schema, ...Schema[]])",
1301
+ value: input
1302
+ }, _errorFactory)))(input, "$input", true);
1303
+ }
1304
+ return input;
1305
+ }; })()(resolved[i]), value[i]));
1306
+ }
1307
+ return (result);
1308
+ }
1309
+ if (typeof resolved === 'object' && resolved !== null) {
1310
+ if ('optional' in resolved) {
1311
+ if (value === undefined) {
1312
+ return (undefined);
1313
+ }
1314
+ return (prepareValueForSchema(resolved.optional, value));
1315
+ }
1316
+ if ('sequenceOf' in resolved) {
1317
+ if (!Array.isArray(value)) {
1318
+ return (value);
1319
+ }
1320
+ return (value.map(item => prepareValueForSchema(resolved.sequenceOf, item)));
1321
+ }
1322
+ if ('choice' in resolved) {
1323
+ const choices = Array.isArray(resolved.choice)
1324
+ ? resolved.choice
1325
+ : Array.from(resolved.choice);
1326
+ for (const choiceSchema of choices) {
1327
+ const preparedChoice = prepareValueForSchema(choiceSchema, value);
1328
+ if (preparedChoice !== value) {
1329
+ return (preparedChoice);
1330
+ }
1331
+ }
1332
+ return (value);
1333
+ }
1334
+ if ('type' in resolved) {
1335
+ switch (resolved.type) {
1336
+ case 'context':
1337
+ return (prepareContextValue(resolved, value, prepareValueForSchema));
1338
+ case 'struct':
1339
+ return (prepareStructValue(resolved, value));
1340
+ default:
1341
+ return (value);
1342
+ }
1343
+ }
1344
+ }
1345
+ return (value);
1346
+ }
1347
+ export function encodeValueBySchema(schema, value, options) {
1348
+ const contextualized = contextualizeStructSchema(schema);
1349
+ try {
1350
+ const preparedUnknown = prepareValueForSchema(contextualized, value);
1351
+ // XXX:TODO Fix depth issue
1352
+ // @ts-ignore
1353
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/consistent-type-assertions
1354
+ return (ValidateASN1.againstSchema(preparedUnknown, contextualized));
1355
+ }
1356
+ catch (err) {
1357
+ const printer = options?.valuePrinter ?? defaultPrintValue;
1358
+ const prefix = options?.attributeName ? `Attribute ${options.attributeName}: ` : '';
1359
+ const message = err instanceof Error ? err.message : String(err);
1360
+ throw (new Error(`${prefix}${message} (value: ${printer(value)})`));
1361
+ }
1362
+ }
1363
+ export function normalizeDecodedASN1(input) {
1364
+ if (input === undefined || input === null) {
1365
+ return (input);
1366
+ }
1367
+ if (Array.isArray(input)) {
1368
+ return (input.map(normalizeDecodedASN1));
1369
+ }
1370
+ if (input instanceof Date) {
1371
+ return (input);
1372
+ }
1373
+ if (Buffer.isBuffer(input) || input instanceof ArrayBuffer) {
1374
+ return (input);
1375
+ }
1376
+ if (isASN1ContextTag(input)) {
1377
+ return (normalizeDecodedASN1(input.contains));
1378
+ }
1379
+ if (isASN1String(input)) {
1380
+ return (normalizeDecodedASN1(input.value));
1381
+ }
1382
+ if (isASN1Date(input)) {
1383
+ return (input.date);
1384
+ }
1385
+ if (isASN1BitString(input)) {
1386
+ return (input.value);
1387
+ }
1388
+ if (isASN1Struct(input)) {
1389
+ const contains = input.contains ?? {};
1390
+ const orderedNames = Array.isArray(input.fieldNames) && input.fieldNames.length > 0
1391
+ ? input.fieldNames
1392
+ : Object.keys(contains);
1393
+ const result = {};
1394
+ for (const fieldName of orderedNames) {
1395
+ if (!Object.prototype.hasOwnProperty.call(contains, fieldName)) {
1396
+ continue;
1397
+ }
1398
+ const fieldValue = contains[fieldName];
1399
+ if (fieldValue !== undefined) {
1400
+ result[fieldName] = normalizeDecodedASN1(fieldValue);
1401
+ }
1402
+ }
1403
+ return (result);
1404
+ }
1405
+ if (isASN1Set(input)) {
1406
+ return ({
1407
+ name: normalizeDecodedASN1(input.name),
1408
+ value: normalizeDecodedASN1(input.value)
1409
+ });
1410
+ }
1411
+ if (isPlainObject(input)) {
1412
+ const result = {};
1413
+ for (const [key, value] of Object.entries(input)) {
1414
+ result[key] = normalizeDecodedASN1(value);
1415
+ }
1416
+ return (result);
1417
+ }
1418
+ return (input);
1419
+ }
7
1420
  export { ASN1toJS, JStoASN1, BufferStorageASN1, ValidateASN1 };
8
1421
  //# sourceMappingURL=asn1.js.map