@nxtedition/types 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/block.d.ts +16 -7
- package/dist/common/block.js +816 -301
- package/dist/common/file.d.ts +21 -12
- package/dist/common/file.js +790 -225
- package/package.json +2 -2
package/dist/common/block.js
CHANGED
|
@@ -1,63 +1,71 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export const isBlock = input => {
|
|
3
|
-
const $io0 = input => "string" === typeof input.
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
4
4
|
return "object" === typeof input && null !== input && $io0(input);
|
|
5
5
|
};
|
|
6
6
|
export const assertBlock = (input, errorFactory) => {
|
|
7
7
|
const __is = input => {
|
|
8
|
-
const $io0 = input => "string" === typeof input.
|
|
8
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
9
9
|
return "object" === typeof input && null !== input && $io0(input);
|
|
10
10
|
};
|
|
11
11
|
if (false === __is(input))
|
|
12
12
|
((input, _path, _exceptionable = true) => {
|
|
13
13
|
const $guard = __typia.createAssert.guard;
|
|
14
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.
|
|
15
|
-
path: _path + ".
|
|
16
|
-
expected: "string &
|
|
17
|
-
value: input.
|
|
18
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
19
|
-
path: _path + ".
|
|
20
|
-
expected: "(string &
|
|
21
|
-
value: input.
|
|
22
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
23
|
-
path: _path + ".
|
|
24
|
-
expected: "string &
|
|
25
|
-
value: input.
|
|
26
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
27
|
-
path: _path + ".
|
|
28
|
-
expected: "(string &
|
|
29
|
-
value: input.
|
|
30
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
31
|
-
path: _path + ".
|
|
32
|
-
expected: "string &
|
|
33
|
-
value: input.
|
|
34
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
|
-
path: _path + ".
|
|
36
|
-
expected: "(string &
|
|
37
|
-
value: input.
|
|
14
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
15
|
+
path: _path + ".id",
|
|
16
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
17
|
+
value: input.id
|
|
18
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
19
|
+
path: _path + ".id",
|
|
20
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
21
|
+
value: input.id
|
|
22
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
23
|
+
path: _path + ".file",
|
|
24
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
25
|
+
value: input.file
|
|
26
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
27
|
+
path: _path + ".file",
|
|
28
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
29
|
+
value: input.file
|
|
30
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
31
|
+
path: _path + ".location",
|
|
32
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
33
|
+
value: input.location
|
|
34
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
|
+
path: _path + ".location",
|
|
36
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
37
|
+
value: input.location
|
|
38
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
39
|
+
path: _path + ".block",
|
|
40
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
41
|
+
value: input.block
|
|
42
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
43
|
+
path: _path + ".block",
|
|
44
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
45
|
+
value: input.block
|
|
38
46
|
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
39
47
|
path: _path + ".offset",
|
|
40
48
|
expected: "number & Minimum<0>",
|
|
41
49
|
value: input.offset
|
|
42
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
50
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
43
51
|
path: _path + ".offset",
|
|
44
|
-
expected: "
|
|
52
|
+
expected: "number & Type<\"uint32\">",
|
|
45
53
|
value: input.offset
|
|
46
|
-
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
47
|
-
path: _path + ".position",
|
|
48
|
-
expected: "number & Minimum<0>",
|
|
49
|
-
value: input.position
|
|
50
54
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
51
|
-
path: _path + ".
|
|
52
|
-
expected: "((number & Minimum<0>) | null)",
|
|
53
|
-
value: input.
|
|
55
|
+
path: _path + ".offset",
|
|
56
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
57
|
+
value: input.offset
|
|
54
58
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
55
59
|
path: _path + ".size",
|
|
56
60
|
expected: "number & Minimum<0>",
|
|
57
61
|
value: input.size
|
|
62
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
63
|
+
path: _path + ".size",
|
|
64
|
+
expected: "number & Type<\"uint32\">",
|
|
65
|
+
value: input.size
|
|
58
66
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
59
67
|
path: _path + ".size",
|
|
60
|
-
expected: "((number & Minimum<0>) | null)",
|
|
68
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
61
69
|
value: input.size
|
|
62
70
|
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
63
71
|
path: _path + ".hash",
|
|
@@ -71,9 +79,13 @@ export const assertBlock = (input, errorFactory) => {
|
|
|
71
79
|
path: _path + ".btime",
|
|
72
80
|
expected: "number & Minimum<0>",
|
|
73
81
|
value: input.btime
|
|
82
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
83
|
+
path: _path + ".btime",
|
|
84
|
+
expected: "number & Type<\"uint32\">",
|
|
85
|
+
value: input.btime
|
|
74
86
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
75
87
|
path: _path + ".btime",
|
|
76
|
-
expected: "((number & Minimum<0>) | null)",
|
|
88
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
77
89
|
value: input.btime
|
|
78
90
|
}, errorFactory));
|
|
79
91
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
@@ -92,27 +104,34 @@ export const randomBlock = generator => {
|
|
|
92
104
|
const $generator = __typia.createRandom.generator;
|
|
93
105
|
const $pick = __typia.createRandom.pick;
|
|
94
106
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
95
|
-
|
|
107
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([
|
|
96
108
|
{
|
|
97
|
-
name: "
|
|
98
|
-
kind: "
|
|
99
|
-
value:
|
|
109
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
110
|
+
kind: "pattern",
|
|
111
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
100
112
|
}
|
|
101
|
-
]) ?? (generator?.
|
|
102
|
-
|
|
113
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
114
|
+
file: (generator?.customs ?? $generator.customs)?.string?.([
|
|
103
115
|
{
|
|
104
|
-
name: "
|
|
105
|
-
kind: "
|
|
106
|
-
value:
|
|
116
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
117
|
+
kind: "pattern",
|
|
118
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
107
119
|
}
|
|
108
|
-
]) ?? (generator?.
|
|
109
|
-
|
|
120
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
121
|
+
location: (generator?.customs ?? $generator.customs)?.string?.([
|
|
110
122
|
{
|
|
111
|
-
name: "
|
|
112
|
-
kind: "
|
|
113
|
-
value:
|
|
123
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
124
|
+
kind: "pattern",
|
|
125
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
114
126
|
}
|
|
115
|
-
]) ?? (generator?.
|
|
127
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
128
|
+
block: (generator?.customs ?? $generator.customs)?.string?.([
|
|
129
|
+
{
|
|
130
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
131
|
+
kind: "pattern",
|
|
132
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
133
|
+
}
|
|
134
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
116
135
|
offset: $pick([
|
|
117
136
|
() => null,
|
|
118
137
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
@@ -120,18 +139,13 @@ export const randomBlock = generator => {
|
|
|
120
139
|
name: "Minimum<0>",
|
|
121
140
|
kind: "minimum",
|
|
122
141
|
value: 0
|
|
123
|
-
}
|
|
124
|
-
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
125
|
-
])(),
|
|
126
|
-
position: $pick([
|
|
127
|
-
() => null,
|
|
128
|
-
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
142
|
+
},
|
|
129
143
|
{
|
|
130
|
-
name: "
|
|
131
|
-
kind: "
|
|
132
|
-
value:
|
|
144
|
+
name: "Type<\"uint32\">",
|
|
145
|
+
kind: "type",
|
|
146
|
+
value: "uint32"
|
|
133
147
|
}
|
|
134
|
-
]) ?? (generator?.
|
|
148
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
135
149
|
])(),
|
|
136
150
|
size: $pick([
|
|
137
151
|
() => null,
|
|
@@ -140,8 +154,13 @@ export const randomBlock = generator => {
|
|
|
140
154
|
name: "Minimum<0>",
|
|
141
155
|
kind: "minimum",
|
|
142
156
|
value: 0
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "Type<\"uint32\">",
|
|
160
|
+
kind: "type",
|
|
161
|
+
value: "uint32"
|
|
143
162
|
}
|
|
144
|
-
]) ?? (generator?.
|
|
163
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
145
164
|
])(),
|
|
146
165
|
hash: $pick([
|
|
147
166
|
() => null,
|
|
@@ -167,67 +186,80 @@ export const randomBlock = generator => {
|
|
|
167
186
|
name: "Minimum<0>",
|
|
168
187
|
kind: "minimum",
|
|
169
188
|
value: 0
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "Type<\"uint32\">",
|
|
192
|
+
kind: "type",
|
|
193
|
+
value: "uint32"
|
|
170
194
|
}
|
|
171
|
-
]) ?? (generator?.
|
|
195
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
172
196
|
])()
|
|
173
197
|
});
|
|
174
198
|
return $ro0();
|
|
175
199
|
};
|
|
176
200
|
export const assertGuardBlock = (input, errorFactory) => {
|
|
177
201
|
const __is = input => {
|
|
178
|
-
const $io0 = input => "string" === typeof input.
|
|
202
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
179
203
|
return "object" === typeof input && null !== input && $io0(input);
|
|
180
204
|
};
|
|
181
205
|
if (false === __is(input))
|
|
182
206
|
((input, _path, _exceptionable = true) => {
|
|
183
207
|
const $guard = __typia.createAssertGuard.guard;
|
|
184
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.
|
|
185
|
-
path: _path + ".
|
|
186
|
-
expected: "string &
|
|
187
|
-
value: input.
|
|
188
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
189
|
-
path: _path + ".
|
|
190
|
-
expected: "(string &
|
|
191
|
-
value: input.
|
|
192
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
193
|
-
path: _path + ".
|
|
194
|
-
expected: "string &
|
|
195
|
-
value: input.
|
|
196
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
197
|
-
path: _path + ".
|
|
198
|
-
expected: "(string &
|
|
199
|
-
value: input.
|
|
200
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
201
|
-
path: _path + ".
|
|
202
|
-
expected: "string &
|
|
203
|
-
value: input.
|
|
204
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
205
|
-
path: _path + ".
|
|
206
|
-
expected: "(string &
|
|
207
|
-
value: input.
|
|
208
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
209
|
+
path: _path + ".id",
|
|
210
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
211
|
+
value: input.id
|
|
212
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
213
|
+
path: _path + ".id",
|
|
214
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
215
|
+
value: input.id
|
|
216
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
217
|
+
path: _path + ".file",
|
|
218
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
219
|
+
value: input.file
|
|
220
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
221
|
+
path: _path + ".file",
|
|
222
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
223
|
+
value: input.file
|
|
224
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
225
|
+
path: _path + ".location",
|
|
226
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
227
|
+
value: input.location
|
|
228
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
229
|
+
path: _path + ".location",
|
|
230
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
231
|
+
value: input.location
|
|
232
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
233
|
+
path: _path + ".block",
|
|
234
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
235
|
+
value: input.block
|
|
236
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
237
|
+
path: _path + ".block",
|
|
238
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
239
|
+
value: input.block
|
|
208
240
|
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
209
241
|
path: _path + ".offset",
|
|
210
242
|
expected: "number & Minimum<0>",
|
|
211
243
|
value: input.offset
|
|
212
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
244
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
213
245
|
path: _path + ".offset",
|
|
214
|
-
expected: "
|
|
246
|
+
expected: "number & Type<\"uint32\">",
|
|
215
247
|
value: input.offset
|
|
216
|
-
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
217
|
-
path: _path + ".position",
|
|
218
|
-
expected: "number & Minimum<0>",
|
|
219
|
-
value: input.position
|
|
220
248
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
221
|
-
path: _path + ".
|
|
222
|
-
expected: "((number & Minimum<0>) | null)",
|
|
223
|
-
value: input.
|
|
249
|
+
path: _path + ".offset",
|
|
250
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
251
|
+
value: input.offset
|
|
224
252
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
225
253
|
path: _path + ".size",
|
|
226
254
|
expected: "number & Minimum<0>",
|
|
227
255
|
value: input.size
|
|
256
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
257
|
+
path: _path + ".size",
|
|
258
|
+
expected: "number & Type<\"uint32\">",
|
|
259
|
+
value: input.size
|
|
228
260
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
229
261
|
path: _path + ".size",
|
|
230
|
-
expected: "((number & Minimum<0>) | null)",
|
|
262
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
231
263
|
value: input.size
|
|
232
264
|
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
233
265
|
path: _path + ".hash",
|
|
@@ -241,9 +273,13 @@ export const assertGuardBlock = (input, errorFactory) => {
|
|
|
241
273
|
path: _path + ".btime",
|
|
242
274
|
expected: "number & Minimum<0>",
|
|
243
275
|
value: input.btime
|
|
276
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
277
|
+
path: _path + ".btime",
|
|
278
|
+
expected: "number & Type<\"uint32\">",
|
|
279
|
+
value: input.btime
|
|
244
280
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
245
281
|
path: _path + ".btime",
|
|
246
|
-
expected: "((number & Minimum<0>) | null)",
|
|
282
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
247
283
|
value: input.btime
|
|
248
284
|
}, errorFactory));
|
|
249
285
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
@@ -259,76 +295,410 @@ export const assertGuardBlock = (input, errorFactory) => {
|
|
|
259
295
|
};
|
|
260
296
|
export const stringifyBlock = input => {
|
|
261
297
|
const $string = __typia.json.createStringify.string;
|
|
262
|
-
const $so0 = input => `{"
|
|
298
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"block":${$string(input.block)},"offset":${null !== input.offset ? input.offset : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
263
299
|
return $so0(input);
|
|
264
300
|
};
|
|
265
301
|
export const assertStringifyBlock = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
266
302
|
const __is = input => {
|
|
267
|
-
const $io0 = input => "string" === typeof input.
|
|
303
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
268
304
|
return "object" === typeof input && null !== input && $io0(input);
|
|
269
305
|
};
|
|
270
306
|
if (false === __is(input))
|
|
271
307
|
((input, _path, _exceptionable = true) => {
|
|
272
308
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
273
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.
|
|
274
|
-
path: _path + ".
|
|
275
|
-
expected: "string &
|
|
276
|
-
value: input.
|
|
277
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
278
|
-
path: _path + ".
|
|
279
|
-
expected: "(string &
|
|
280
|
-
value: input.
|
|
281
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
282
|
-
path: _path + ".
|
|
283
|
-
expected: "string &
|
|
284
|
-
value: input.
|
|
285
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
286
|
-
path: _path + ".
|
|
287
|
-
expected: "(string &
|
|
288
|
-
value: input.
|
|
289
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
290
|
-
path: _path + ".
|
|
291
|
-
expected: "string &
|
|
292
|
-
value: input.
|
|
293
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
294
|
-
path: _path + ".
|
|
295
|
-
expected: "(string &
|
|
296
|
-
value: input.
|
|
297
|
-
}, errorFactory)) && (
|
|
309
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
310
|
+
path: _path + ".id",
|
|
311
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
312
|
+
value: input.id
|
|
313
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
314
|
+
path: _path + ".id",
|
|
315
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
316
|
+
value: input.id
|
|
317
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
318
|
+
path: _path + ".file",
|
|
319
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
320
|
+
value: input.file
|
|
321
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
322
|
+
path: _path + ".file",
|
|
323
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
324
|
+
value: input.file
|
|
325
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
326
|
+
path: _path + ".location",
|
|
327
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
328
|
+
value: input.location
|
|
329
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
330
|
+
path: _path + ".location",
|
|
331
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
332
|
+
value: input.location
|
|
333
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
334
|
+
path: _path + ".block",
|
|
335
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
336
|
+
value: input.block
|
|
337
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
338
|
+
path: _path + ".block",
|
|
339
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
340
|
+
value: input.block
|
|
341
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
298
342
|
path: _path + ".offset",
|
|
299
|
-
expected: "number",
|
|
343
|
+
expected: "number & Minimum<0>",
|
|
300
344
|
value: input.offset
|
|
301
|
-
}, errorFactory)) && (0 <= input.offset || $guard(_exceptionable, {
|
|
345
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
302
346
|
path: _path + ".offset",
|
|
303
|
-
expected: "number &
|
|
347
|
+
expected: "number & Type<\"uint32\">",
|
|
304
348
|
value: input.offset
|
|
305
349
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
306
350
|
path: _path + ".offset",
|
|
307
|
-
expected: "((number & Minimum<0>) | null)",
|
|
351
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
308
352
|
value: input.offset
|
|
309
|
-
}, errorFactory)) && (null === input.
|
|
353
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
354
|
+
path: _path + ".size",
|
|
355
|
+
expected: "number & Minimum<0>",
|
|
356
|
+
value: input.size
|
|
357
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
358
|
+
path: _path + ".size",
|
|
359
|
+
expected: "number & Type<\"uint32\">",
|
|
360
|
+
value: input.size
|
|
361
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
362
|
+
path: _path + ".size",
|
|
363
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
364
|
+
value: input.size
|
|
365
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
366
|
+
path: _path + ".hash",
|
|
367
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
368
|
+
value: input.hash
|
|
369
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
370
|
+
path: _path + ".hash",
|
|
371
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
372
|
+
value: input.hash
|
|
373
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
374
|
+
path: _path + ".btime",
|
|
375
|
+
expected: "number & Minimum<0>",
|
|
376
|
+
value: input.btime
|
|
377
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
378
|
+
path: _path + ".btime",
|
|
379
|
+
expected: "number & Type<\"uint32\">",
|
|
380
|
+
value: input.btime
|
|
381
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
382
|
+
path: _path + ".btime",
|
|
383
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
384
|
+
value: input.btime
|
|
385
|
+
}, errorFactory));
|
|
386
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
387
|
+
path: _path + "",
|
|
388
|
+
expected: "Block",
|
|
389
|
+
value: input
|
|
390
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
391
|
+
path: _path + "",
|
|
392
|
+
expected: "Block",
|
|
393
|
+
value: input
|
|
394
|
+
}, errorFactory);
|
|
395
|
+
})(input, "$input", true);
|
|
396
|
+
return input;
|
|
397
|
+
}; const stringify = input => {
|
|
398
|
+
const $string = __typia.json.createAssertStringify.string;
|
|
399
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"block":${$string(input.block)},"offset":${null !== input.offset ? input.offset : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
400
|
+
return $so0(input);
|
|
401
|
+
}; return stringify(assert(input, errorFactory)); };
|
|
402
|
+
export const isBlockStats = input => {
|
|
403
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295))) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
404
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
405
|
+
};
|
|
406
|
+
export const assertBlockStats = (input, errorFactory) => {
|
|
407
|
+
const __is = input => {
|
|
408
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295))) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
409
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
410
|
+
};
|
|
411
|
+
if (false === __is(input))
|
|
412
|
+
((input, _path, _exceptionable = true) => {
|
|
413
|
+
const $guard = __typia.createAssert.guard;
|
|
414
|
+
const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
310
415
|
path: _path + ".position",
|
|
311
|
-
expected: "number",
|
|
416
|
+
expected: "number & Minimum<0>",
|
|
312
417
|
value: input.position
|
|
313
|
-
}, errorFactory)) && (0 <= input.position || $guard(_exceptionable, {
|
|
418
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295 || $guard(_exceptionable, {
|
|
314
419
|
path: _path + ".position",
|
|
315
|
-
expected: "number &
|
|
420
|
+
expected: "number & Type<\"uint32\">",
|
|
316
421
|
value: input.position
|
|
317
422
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
318
423
|
path: _path + ".position",
|
|
319
|
-
expected: "((number & Minimum<0>) | null)",
|
|
424
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
320
425
|
value: input.position
|
|
321
|
-
}, errorFactory)) && (
|
|
426
|
+
}, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
427
|
+
path: _path + ".id",
|
|
428
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
429
|
+
value: input.id
|
|
430
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
431
|
+
path: _path + ".id",
|
|
432
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
433
|
+
value: input.id
|
|
434
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
435
|
+
path: _path + ".file",
|
|
436
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
437
|
+
value: input.file
|
|
438
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
439
|
+
path: _path + ".file",
|
|
440
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
441
|
+
value: input.file
|
|
442
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
443
|
+
path: _path + ".location",
|
|
444
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
445
|
+
value: input.location
|
|
446
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
447
|
+
path: _path + ".location",
|
|
448
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
449
|
+
value: input.location
|
|
450
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
451
|
+
path: _path + ".block",
|
|
452
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
453
|
+
value: input.block
|
|
454
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
455
|
+
path: _path + ".block",
|
|
456
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
457
|
+
value: input.block
|
|
458
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
459
|
+
path: _path + ".offset",
|
|
460
|
+
expected: "number & Minimum<0>",
|
|
461
|
+
value: input.offset
|
|
462
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
463
|
+
path: _path + ".offset",
|
|
464
|
+
expected: "number & Type<\"uint32\">",
|
|
465
|
+
value: input.offset
|
|
466
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
467
|
+
path: _path + ".offset",
|
|
468
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
469
|
+
value: input.offset
|
|
470
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
471
|
+
path: _path + ".size",
|
|
472
|
+
expected: "number & Minimum<0>",
|
|
473
|
+
value: input.size
|
|
474
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
475
|
+
path: _path + ".size",
|
|
476
|
+
expected: "number & Type<\"uint32\">",
|
|
477
|
+
value: input.size
|
|
478
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
322
479
|
path: _path + ".size",
|
|
323
|
-
expected: "number",
|
|
480
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
324
481
|
value: input.size
|
|
325
|
-
}, errorFactory)) && (
|
|
482
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
483
|
+
path: _path + ".hash",
|
|
484
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
485
|
+
value: input.hash
|
|
486
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
487
|
+
path: _path + ".hash",
|
|
488
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
489
|
+
value: input.hash
|
|
490
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
491
|
+
path: _path + ".btime",
|
|
492
|
+
expected: "number & Minimum<0>",
|
|
493
|
+
value: input.btime
|
|
494
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
495
|
+
path: _path + ".btime",
|
|
496
|
+
expected: "number & Type<\"uint32\">",
|
|
497
|
+
value: input.btime
|
|
498
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
499
|
+
path: _path + ".btime",
|
|
500
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
501
|
+
value: input.btime
|
|
502
|
+
}, errorFactory));
|
|
503
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
504
|
+
path: _path + "",
|
|
505
|
+
expected: "BlockStats",
|
|
506
|
+
value: input
|
|
507
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
508
|
+
path: _path + "",
|
|
509
|
+
expected: "BlockStats",
|
|
510
|
+
value: input
|
|
511
|
+
}, errorFactory);
|
|
512
|
+
})(input, "$input", true);
|
|
513
|
+
return input;
|
|
514
|
+
};
|
|
515
|
+
export const randomBlockStats = generator => {
|
|
516
|
+
const $generator = __typia.createRandom.generator;
|
|
517
|
+
const $pick = __typia.createRandom.pick;
|
|
518
|
+
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
519
|
+
position: $pick([
|
|
520
|
+
() => null,
|
|
521
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
522
|
+
{
|
|
523
|
+
name: "Minimum<0>",
|
|
524
|
+
kind: "minimum",
|
|
525
|
+
value: 0
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
name: "Type<\"uint32\">",
|
|
529
|
+
kind: "type",
|
|
530
|
+
value: "uint32"
|
|
531
|
+
}
|
|
532
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
533
|
+
])(),
|
|
534
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([
|
|
535
|
+
{
|
|
536
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
537
|
+
kind: "pattern",
|
|
538
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
539
|
+
}
|
|
540
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
541
|
+
file: (generator?.customs ?? $generator.customs)?.string?.([
|
|
542
|
+
{
|
|
543
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
544
|
+
kind: "pattern",
|
|
545
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
546
|
+
}
|
|
547
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
548
|
+
location: (generator?.customs ?? $generator.customs)?.string?.([
|
|
549
|
+
{
|
|
550
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
551
|
+
kind: "pattern",
|
|
552
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
553
|
+
}
|
|
554
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
555
|
+
block: (generator?.customs ?? $generator.customs)?.string?.([
|
|
556
|
+
{
|
|
557
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
558
|
+
kind: "pattern",
|
|
559
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
560
|
+
}
|
|
561
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
562
|
+
offset: $pick([
|
|
563
|
+
() => null,
|
|
564
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
565
|
+
{
|
|
566
|
+
name: "Minimum<0>",
|
|
567
|
+
kind: "minimum",
|
|
568
|
+
value: 0
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: "Type<\"uint32\">",
|
|
572
|
+
kind: "type",
|
|
573
|
+
value: "uint32"
|
|
574
|
+
}
|
|
575
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
576
|
+
])(),
|
|
577
|
+
size: $pick([
|
|
578
|
+
() => null,
|
|
579
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
580
|
+
{
|
|
581
|
+
name: "Minimum<0>",
|
|
582
|
+
kind: "minimum",
|
|
583
|
+
value: 0
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: "Type<\"uint32\">",
|
|
587
|
+
kind: "type",
|
|
588
|
+
value: "uint32"
|
|
589
|
+
}
|
|
590
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
591
|
+
])(),
|
|
592
|
+
hash: $pick([
|
|
593
|
+
() => null,
|
|
594
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
595
|
+
{
|
|
596
|
+
name: "MaxLength<0>",
|
|
597
|
+
kind: "maxLength",
|
|
598
|
+
value: 0
|
|
599
|
+
}
|
|
600
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(0, 0)),
|
|
601
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
602
|
+
{
|
|
603
|
+
name: "Pattern<\"^[A-Fa-f0-9]{32}$\">",
|
|
604
|
+
kind: "pattern",
|
|
605
|
+
value: "^[A-Fa-f0-9]{32}$"
|
|
606
|
+
}
|
|
607
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[A-Fa-f0-9]{32}$/)
|
|
608
|
+
])(),
|
|
609
|
+
btime: $pick([
|
|
610
|
+
() => null,
|
|
611
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
612
|
+
{
|
|
613
|
+
name: "Minimum<0>",
|
|
614
|
+
kind: "minimum",
|
|
615
|
+
value: 0
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
name: "Type<\"uint32\">",
|
|
619
|
+
kind: "type",
|
|
620
|
+
value: "uint32"
|
|
621
|
+
}
|
|
622
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
623
|
+
])()
|
|
624
|
+
});
|
|
625
|
+
return $ro0();
|
|
626
|
+
};
|
|
627
|
+
export const assertGuardBlockStats = (input, errorFactory) => {
|
|
628
|
+
const __is = input => {
|
|
629
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295))) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
630
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
631
|
+
};
|
|
632
|
+
if (false === __is(input))
|
|
633
|
+
((input, _path, _exceptionable = true) => {
|
|
634
|
+
const $guard = __typia.createAssertGuard.guard;
|
|
635
|
+
const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
636
|
+
path: _path + ".position",
|
|
637
|
+
expected: "number & Minimum<0>",
|
|
638
|
+
value: input.position
|
|
639
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295 || $guard(_exceptionable, {
|
|
640
|
+
path: _path + ".position",
|
|
641
|
+
expected: "number & Type<\"uint32\">",
|
|
642
|
+
value: input.position
|
|
643
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
644
|
+
path: _path + ".position",
|
|
645
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
646
|
+
value: input.position
|
|
647
|
+
}, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
648
|
+
path: _path + ".id",
|
|
649
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
650
|
+
value: input.id
|
|
651
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
652
|
+
path: _path + ".id",
|
|
653
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
654
|
+
value: input.id
|
|
655
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
656
|
+
path: _path + ".file",
|
|
657
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
658
|
+
value: input.file
|
|
659
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
660
|
+
path: _path + ".file",
|
|
661
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
662
|
+
value: input.file
|
|
663
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
664
|
+
path: _path + ".location",
|
|
665
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
666
|
+
value: input.location
|
|
667
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
668
|
+
path: _path + ".location",
|
|
669
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
670
|
+
value: input.location
|
|
671
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
672
|
+
path: _path + ".block",
|
|
673
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
674
|
+
value: input.block
|
|
675
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
676
|
+
path: _path + ".block",
|
|
677
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
678
|
+
value: input.block
|
|
679
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
680
|
+
path: _path + ".offset",
|
|
681
|
+
expected: "number & Minimum<0>",
|
|
682
|
+
value: input.offset
|
|
683
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
684
|
+
path: _path + ".offset",
|
|
685
|
+
expected: "number & Type<\"uint32\">",
|
|
686
|
+
value: input.offset
|
|
687
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
688
|
+
path: _path + ".offset",
|
|
689
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
690
|
+
value: input.offset
|
|
691
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
326
692
|
path: _path + ".size",
|
|
327
693
|
expected: "number & Minimum<0>",
|
|
328
694
|
value: input.size
|
|
695
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
696
|
+
path: _path + ".size",
|
|
697
|
+
expected: "number & Type<\"uint32\">",
|
|
698
|
+
value: input.size
|
|
329
699
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
330
700
|
path: _path + ".size",
|
|
331
|
-
expected: "((number & Minimum<0>) | null)",
|
|
701
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
332
702
|
value: input.size
|
|
333
703
|
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
334
704
|
path: _path + ".hash",
|
|
@@ -338,94 +708,215 @@ export const assertStringifyBlock = (input, errorFactory) => { const assert = (i
|
|
|
338
708
|
path: _path + ".hash",
|
|
339
709
|
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
340
710
|
value: input.hash
|
|
341
|
-
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (
|
|
711
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
712
|
+
path: _path + ".btime",
|
|
713
|
+
expected: "number & Minimum<0>",
|
|
714
|
+
value: input.btime
|
|
715
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
342
716
|
path: _path + ".btime",
|
|
343
|
-
expected: "number",
|
|
717
|
+
expected: "number & Type<\"uint32\">",
|
|
344
718
|
value: input.btime
|
|
345
|
-
}, errorFactory))
|
|
719
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
720
|
+
path: _path + ".btime",
|
|
721
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
722
|
+
value: input.btime
|
|
723
|
+
}, errorFactory));
|
|
724
|
+
return ("object" === typeof input && null !== input || $guard(true, {
|
|
725
|
+
path: _path + "",
|
|
726
|
+
expected: "BlockStats",
|
|
727
|
+
value: input
|
|
728
|
+
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
729
|
+
path: _path + "",
|
|
730
|
+
expected: "BlockStats",
|
|
731
|
+
value: input
|
|
732
|
+
}, errorFactory);
|
|
733
|
+
})(input, "$input", true);
|
|
734
|
+
};
|
|
735
|
+
export const stringifyBlockStats = input => {
|
|
736
|
+
const $string = __typia.json.createStringify.string;
|
|
737
|
+
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"block":${$string(input.block)},"offset":${null !== input.offset ? input.offset : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
738
|
+
return $so0(input);
|
|
739
|
+
};
|
|
740
|
+
export const assertStringifyBlockStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
741
|
+
const __is = input => {
|
|
742
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295))) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
743
|
+
return "object" === typeof input && null !== input && $io0(input);
|
|
744
|
+
};
|
|
745
|
+
if (false === __is(input))
|
|
746
|
+
((input, _path, _exceptionable = true) => {
|
|
747
|
+
const $guard = __typia.json.createAssertStringify.guard;
|
|
748
|
+
const $ao0 = (input, _path, _exceptionable = true) => (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
749
|
+
path: _path + ".position",
|
|
750
|
+
expected: "number & Minimum<0>",
|
|
751
|
+
value: input.position
|
|
752
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295 || $guard(_exceptionable, {
|
|
753
|
+
path: _path + ".position",
|
|
754
|
+
expected: "number & Type<\"uint32\">",
|
|
755
|
+
value: input.position
|
|
756
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
757
|
+
path: _path + ".position",
|
|
758
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
759
|
+
value: input.position
|
|
760
|
+
}, errorFactory)) && ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
761
|
+
path: _path + ".id",
|
|
762
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
763
|
+
value: input.id
|
|
764
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
765
|
+
path: _path + ".id",
|
|
766
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
767
|
+
value: input.id
|
|
768
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
769
|
+
path: _path + ".file",
|
|
770
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
771
|
+
value: input.file
|
|
772
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
773
|
+
path: _path + ".file",
|
|
774
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
775
|
+
value: input.file
|
|
776
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
777
|
+
path: _path + ".location",
|
|
778
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
779
|
+
value: input.location
|
|
780
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
781
|
+
path: _path + ".location",
|
|
782
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
783
|
+
value: input.location
|
|
784
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
785
|
+
path: _path + ".block",
|
|
786
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
787
|
+
value: input.block
|
|
788
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
789
|
+
path: _path + ".block",
|
|
790
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
791
|
+
value: input.block
|
|
792
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
793
|
+
path: _path + ".offset",
|
|
794
|
+
expected: "number & Minimum<0>",
|
|
795
|
+
value: input.offset
|
|
796
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
797
|
+
path: _path + ".offset",
|
|
798
|
+
expected: "number & Type<\"uint32\">",
|
|
799
|
+
value: input.offset
|
|
800
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
801
|
+
path: _path + ".offset",
|
|
802
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
803
|
+
value: input.offset
|
|
804
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
805
|
+
path: _path + ".size",
|
|
806
|
+
expected: "number & Minimum<0>",
|
|
807
|
+
value: input.size
|
|
808
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
809
|
+
path: _path + ".size",
|
|
810
|
+
expected: "number & Type<\"uint32\">",
|
|
811
|
+
value: input.size
|
|
812
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
813
|
+
path: _path + ".size",
|
|
814
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
815
|
+
value: input.size
|
|
816
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
817
|
+
path: _path + ".hash",
|
|
818
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
819
|
+
value: input.hash
|
|
820
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
821
|
+
path: _path + ".hash",
|
|
822
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
823
|
+
value: input.hash
|
|
824
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
346
825
|
path: _path + ".btime",
|
|
347
826
|
expected: "number & Minimum<0>",
|
|
348
827
|
value: input.btime
|
|
828
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
829
|
+
path: _path + ".btime",
|
|
830
|
+
expected: "number & Type<\"uint32\">",
|
|
831
|
+
value: input.btime
|
|
349
832
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
350
833
|
path: _path + ".btime",
|
|
351
|
-
expected: "((number & Minimum<0>) | null)",
|
|
834
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
352
835
|
value: input.btime
|
|
353
836
|
}, errorFactory));
|
|
354
837
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
355
838
|
path: _path + "",
|
|
356
|
-
expected: "
|
|
839
|
+
expected: "BlockStats",
|
|
357
840
|
value: input
|
|
358
841
|
}, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
|
|
359
842
|
path: _path + "",
|
|
360
|
-
expected: "
|
|
843
|
+
expected: "BlockStats",
|
|
361
844
|
value: input
|
|
362
845
|
}, errorFactory);
|
|
363
846
|
})(input, "$input", true);
|
|
364
847
|
return input;
|
|
365
848
|
}; const stringify = input => {
|
|
366
849
|
const $string = __typia.json.createAssertStringify.string;
|
|
367
|
-
const $so0 = input => `{"
|
|
850
|
+
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"block":${$string(input.block)},"offset":${null !== input.offset ? input.offset : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
368
851
|
return $so0(input);
|
|
369
852
|
}; return stringify(assert(input, errorFactory)); };
|
|
370
853
|
export const isBlocks = input => {
|
|
371
|
-
const $io0 = input => "string" === typeof input.
|
|
854
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
372
855
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
373
856
|
};
|
|
374
857
|
export const assertBlocks = (input, errorFactory) => {
|
|
375
858
|
const __is = input => {
|
|
376
|
-
const $io0 = input => "string" === typeof input.
|
|
859
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
377
860
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
378
861
|
};
|
|
379
862
|
if (false === __is(input))
|
|
380
863
|
((input, _path, _exceptionable = true) => {
|
|
381
864
|
const $guard = __typia.createAssert.guard;
|
|
382
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.
|
|
383
|
-
path: _path + ".
|
|
384
|
-
expected: "string &
|
|
385
|
-
value: input.
|
|
386
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
387
|
-
path: _path + ".
|
|
388
|
-
expected: "(string &
|
|
389
|
-
value: input.
|
|
390
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
391
|
-
path: _path + ".
|
|
392
|
-
expected: "string &
|
|
393
|
-
value: input.
|
|
394
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
395
|
-
path: _path + ".
|
|
396
|
-
expected: "(string &
|
|
397
|
-
value: input.
|
|
398
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
399
|
-
path: _path + ".
|
|
400
|
-
expected: "string &
|
|
401
|
-
value: input.
|
|
402
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
403
|
-
path: _path + ".
|
|
404
|
-
expected: "(string &
|
|
405
|
-
value: input.
|
|
865
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
866
|
+
path: _path + ".id",
|
|
867
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
868
|
+
value: input.id
|
|
869
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
870
|
+
path: _path + ".id",
|
|
871
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
872
|
+
value: input.id
|
|
873
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
874
|
+
path: _path + ".file",
|
|
875
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
876
|
+
value: input.file
|
|
877
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
878
|
+
path: _path + ".file",
|
|
879
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
880
|
+
value: input.file
|
|
881
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
882
|
+
path: _path + ".location",
|
|
883
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
884
|
+
value: input.location
|
|
885
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
886
|
+
path: _path + ".location",
|
|
887
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
888
|
+
value: input.location
|
|
889
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
890
|
+
path: _path + ".block",
|
|
891
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
892
|
+
value: input.block
|
|
893
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
894
|
+
path: _path + ".block",
|
|
895
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
896
|
+
value: input.block
|
|
406
897
|
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
407
898
|
path: _path + ".offset",
|
|
408
899
|
expected: "number & Minimum<0>",
|
|
409
900
|
value: input.offset
|
|
410
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
901
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
411
902
|
path: _path + ".offset",
|
|
412
|
-
expected: "
|
|
903
|
+
expected: "number & Type<\"uint32\">",
|
|
413
904
|
value: input.offset
|
|
414
|
-
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
415
|
-
path: _path + ".position",
|
|
416
|
-
expected: "number & Minimum<0>",
|
|
417
|
-
value: input.position
|
|
418
905
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
419
|
-
path: _path + ".
|
|
420
|
-
expected: "((number & Minimum<0>) | null)",
|
|
421
|
-
value: input.
|
|
906
|
+
path: _path + ".offset",
|
|
907
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
908
|
+
value: input.offset
|
|
422
909
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
423
910
|
path: _path + ".size",
|
|
424
911
|
expected: "number & Minimum<0>",
|
|
425
912
|
value: input.size
|
|
913
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
914
|
+
path: _path + ".size",
|
|
915
|
+
expected: "number & Type<\"uint32\">",
|
|
916
|
+
value: input.size
|
|
426
917
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
427
918
|
path: _path + ".size",
|
|
428
|
-
expected: "((number & Minimum<0>) | null)",
|
|
919
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
429
920
|
value: input.size
|
|
430
921
|
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
431
922
|
path: _path + ".hash",
|
|
@@ -439,9 +930,13 @@ export const assertBlocks = (input, errorFactory) => {
|
|
|
439
930
|
path: _path + ".btime",
|
|
440
931
|
expected: "number & Minimum<0>",
|
|
441
932
|
value: input.btime
|
|
933
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
934
|
+
path: _path + ".btime",
|
|
935
|
+
expected: "number & Type<\"uint32\">",
|
|
936
|
+
value: input.btime
|
|
442
937
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
443
938
|
path: _path + ".btime",
|
|
444
|
-
expected: "((number & Minimum<0>) | null)",
|
|
939
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
445
940
|
value: input.btime
|
|
446
941
|
}, errorFactory));
|
|
447
942
|
return (Array.isArray(input) || $guard(true, {
|
|
@@ -468,27 +963,34 @@ export const randomBlocks = generator => {
|
|
|
468
963
|
const $generator = __typia.createRandom.generator;
|
|
469
964
|
const $pick = __typia.createRandom.pick;
|
|
470
965
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
471
|
-
|
|
966
|
+
id: (generator?.customs ?? $generator.customs)?.string?.([
|
|
967
|
+
{
|
|
968
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
969
|
+
kind: "pattern",
|
|
970
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
971
|
+
}
|
|
972
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
973
|
+
file: (generator?.customs ?? $generator.customs)?.string?.([
|
|
472
974
|
{
|
|
473
|
-
name: "
|
|
474
|
-
kind: "
|
|
475
|
-
value:
|
|
975
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
976
|
+
kind: "pattern",
|
|
977
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
476
978
|
}
|
|
477
|
-
]) ?? (generator?.
|
|
478
|
-
|
|
979
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
980
|
+
location: (generator?.customs ?? $generator.customs)?.string?.([
|
|
479
981
|
{
|
|
480
|
-
name: "
|
|
481
|
-
kind: "
|
|
482
|
-
value:
|
|
982
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
983
|
+
kind: "pattern",
|
|
984
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
483
985
|
}
|
|
484
|
-
]) ?? (generator?.
|
|
485
|
-
|
|
986
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
987
|
+
block: (generator?.customs ?? $generator.customs)?.string?.([
|
|
486
988
|
{
|
|
487
|
-
name: "
|
|
488
|
-
kind: "
|
|
489
|
-
value:
|
|
989
|
+
name: "Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
990
|
+
kind: "pattern",
|
|
991
|
+
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
490
992
|
}
|
|
491
|
-
]) ?? (generator?.
|
|
993
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
492
994
|
offset: $pick([
|
|
493
995
|
() => null,
|
|
494
996
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
@@ -496,18 +998,13 @@ export const randomBlocks = generator => {
|
|
|
496
998
|
name: "Minimum<0>",
|
|
497
999
|
kind: "minimum",
|
|
498
1000
|
value: 0
|
|
499
|
-
}
|
|
500
|
-
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
501
|
-
])(),
|
|
502
|
-
position: $pick([
|
|
503
|
-
() => null,
|
|
504
|
-
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
1001
|
+
},
|
|
505
1002
|
{
|
|
506
|
-
name: "
|
|
507
|
-
kind: "
|
|
508
|
-
value:
|
|
1003
|
+
name: "Type<\"uint32\">",
|
|
1004
|
+
kind: "type",
|
|
1005
|
+
value: "uint32"
|
|
509
1006
|
}
|
|
510
|
-
]) ?? (generator?.
|
|
1007
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
511
1008
|
])(),
|
|
512
1009
|
size: $pick([
|
|
513
1010
|
() => null,
|
|
@@ -516,8 +1013,13 @@ export const randomBlocks = generator => {
|
|
|
516
1013
|
name: "Minimum<0>",
|
|
517
1014
|
kind: "minimum",
|
|
518
1015
|
value: 0
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
name: "Type<\"uint32\">",
|
|
1019
|
+
kind: "type",
|
|
1020
|
+
value: "uint32"
|
|
519
1021
|
}
|
|
520
|
-
]) ?? (generator?.
|
|
1022
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
521
1023
|
])(),
|
|
522
1024
|
hash: $pick([
|
|
523
1025
|
() => null,
|
|
@@ -543,67 +1045,80 @@ export const randomBlocks = generator => {
|
|
|
543
1045
|
name: "Minimum<0>",
|
|
544
1046
|
kind: "minimum",
|
|
545
1047
|
value: 0
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
name: "Type<\"uint32\">",
|
|
1051
|
+
kind: "type",
|
|
1052
|
+
value: "uint32"
|
|
546
1053
|
}
|
|
547
|
-
]) ?? (generator?.
|
|
1054
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
548
1055
|
])()
|
|
549
1056
|
});
|
|
550
1057
|
return (generator?.array ?? $generator.array)(() => $ro0());
|
|
551
1058
|
};
|
|
552
1059
|
export const assertGuardBlocks = (input, errorFactory) => {
|
|
553
1060
|
const __is = input => {
|
|
554
|
-
const $io0 = input => "string" === typeof input.
|
|
1061
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
555
1062
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
556
1063
|
};
|
|
557
1064
|
if (false === __is(input))
|
|
558
1065
|
((input, _path, _exceptionable = true) => {
|
|
559
1066
|
const $guard = __typia.createAssertGuard.guard;
|
|
560
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.
|
|
561
|
-
path: _path + ".
|
|
562
|
-
expected: "string &
|
|
563
|
-
value: input.
|
|
564
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
565
|
-
path: _path + ".
|
|
566
|
-
expected: "(string &
|
|
567
|
-
value: input.
|
|
568
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
569
|
-
path: _path + ".
|
|
570
|
-
expected: "string &
|
|
571
|
-
value: input.
|
|
572
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
573
|
-
path: _path + ".
|
|
574
|
-
expected: "(string &
|
|
575
|
-
value: input.
|
|
576
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
577
|
-
path: _path + ".
|
|
578
|
-
expected: "string &
|
|
579
|
-
value: input.
|
|
580
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
581
|
-
path: _path + ".
|
|
582
|
-
expected: "(string &
|
|
583
|
-
value: input.
|
|
1067
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
1068
|
+
path: _path + ".id",
|
|
1069
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1070
|
+
value: input.id
|
|
1071
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1072
|
+
path: _path + ".id",
|
|
1073
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1074
|
+
value: input.id
|
|
1075
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
1076
|
+
path: _path + ".file",
|
|
1077
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1078
|
+
value: input.file
|
|
1079
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1080
|
+
path: _path + ".file",
|
|
1081
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1082
|
+
value: input.file
|
|
1083
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
1084
|
+
path: _path + ".location",
|
|
1085
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1086
|
+
value: input.location
|
|
1087
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1088
|
+
path: _path + ".location",
|
|
1089
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1090
|
+
value: input.location
|
|
1091
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
1092
|
+
path: _path + ".block",
|
|
1093
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1094
|
+
value: input.block
|
|
1095
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1096
|
+
path: _path + ".block",
|
|
1097
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1098
|
+
value: input.block
|
|
584
1099
|
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
585
1100
|
path: _path + ".offset",
|
|
586
1101
|
expected: "number & Minimum<0>",
|
|
587
1102
|
value: input.offset
|
|
588
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
1103
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
589
1104
|
path: _path + ".offset",
|
|
590
|
-
expected: "
|
|
1105
|
+
expected: "number & Type<\"uint32\">",
|
|
591
1106
|
value: input.offset
|
|
592
|
-
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
593
|
-
path: _path + ".position",
|
|
594
|
-
expected: "number & Minimum<0>",
|
|
595
|
-
value: input.position
|
|
596
1107
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
597
|
-
path: _path + ".
|
|
598
|
-
expected: "((number & Minimum<0>) | null)",
|
|
599
|
-
value: input.
|
|
1108
|
+
path: _path + ".offset",
|
|
1109
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
1110
|
+
value: input.offset
|
|
600
1111
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
601
1112
|
path: _path + ".size",
|
|
602
1113
|
expected: "number & Minimum<0>",
|
|
603
1114
|
value: input.size
|
|
1115
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
1116
|
+
path: _path + ".size",
|
|
1117
|
+
expected: "number & Type<\"uint32\">",
|
|
1118
|
+
value: input.size
|
|
604
1119
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
605
1120
|
path: _path + ".size",
|
|
606
|
-
expected: "((number & Minimum<0>) | null)",
|
|
1121
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
607
1122
|
value: input.size
|
|
608
1123
|
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
609
1124
|
path: _path + ".hash",
|
|
@@ -617,9 +1132,13 @@ export const assertGuardBlocks = (input, errorFactory) => {
|
|
|
617
1132
|
path: _path + ".btime",
|
|
618
1133
|
expected: "number & Minimum<0>",
|
|
619
1134
|
value: input.btime
|
|
1135
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
1136
|
+
path: _path + ".btime",
|
|
1137
|
+
expected: "number & Type<\"uint32\">",
|
|
1138
|
+
value: input.btime
|
|
620
1139
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
621
1140
|
path: _path + ".btime",
|
|
622
|
-
expected: "((number & Minimum<0>) | null)",
|
|
1141
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
623
1142
|
value: input.btime
|
|
624
1143
|
}, errorFactory));
|
|
625
1144
|
return (Array.isArray(input) || $guard(true, {
|
|
@@ -643,76 +1162,72 @@ export const assertGuardBlocks = (input, errorFactory) => {
|
|
|
643
1162
|
};
|
|
644
1163
|
export const stringifyBlocks = input => {
|
|
645
1164
|
const $string = __typia.json.createStringify.string;
|
|
646
|
-
const $so0 = input => `{"
|
|
1165
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"block":${$string(input.block)},"offset":${null !== input.offset ? input.offset : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
647
1166
|
return `[${input.map(elem => $so0(elem)).join(",")}]`;
|
|
648
1167
|
};
|
|
649
1168
|
export const assertStringifyBlocks = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
650
1169
|
const __is = input => {
|
|
651
|
-
const $io0 = input => "string" === typeof input.
|
|
1170
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("string" === typeof input.file && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file)) && ("string" === typeof input.location && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location)) && ("string" === typeof input.block && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295))) && (null === input.size || "number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash))) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
652
1171
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
653
1172
|
};
|
|
654
1173
|
if (false === __is(input))
|
|
655
1174
|
((input, _path, _exceptionable = true) => {
|
|
656
1175
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
657
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.
|
|
658
|
-
path: _path + ".
|
|
659
|
-
expected: "string &
|
|
660
|
-
value: input.
|
|
661
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
662
|
-
path: _path + ".
|
|
663
|
-
expected: "(string &
|
|
664
|
-
value: input.
|
|
665
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
666
|
-
path: _path + ".
|
|
667
|
-
expected: "string &
|
|
668
|
-
value: input.
|
|
669
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
670
|
-
path: _path + ".
|
|
671
|
-
expected: "(string &
|
|
672
|
-
value: input.
|
|
673
|
-
}, errorFactory)) && ("string" === typeof input.
|
|
674
|
-
path: _path + ".
|
|
675
|
-
expected: "string &
|
|
676
|
-
value: input.
|
|
677
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
678
|
-
path: _path + ".
|
|
679
|
-
expected: "(string &
|
|
680
|
-
value: input.
|
|
681
|
-
}, errorFactory)) && (
|
|
1176
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) || $guard(_exceptionable, {
|
|
1177
|
+
path: _path + ".id",
|
|
1178
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1179
|
+
value: input.id
|
|
1180
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1181
|
+
path: _path + ".id",
|
|
1182
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1183
|
+
value: input.id
|
|
1184
|
+
}, errorFactory)) && ("string" === typeof input.file && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.file) || $guard(_exceptionable, {
|
|
1185
|
+
path: _path + ".file",
|
|
1186
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1187
|
+
value: input.file
|
|
1188
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1189
|
+
path: _path + ".file",
|
|
1190
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1191
|
+
value: input.file
|
|
1192
|
+
}, errorFactory)) && ("string" === typeof input.location && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.location) || $guard(_exceptionable, {
|
|
1193
|
+
path: _path + ".location",
|
|
1194
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1195
|
+
value: input.location
|
|
1196
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1197
|
+
path: _path + ".location",
|
|
1198
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1199
|
+
value: input.location
|
|
1200
|
+
}, errorFactory)) && ("string" === typeof input.block && (/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.block) || $guard(_exceptionable, {
|
|
1201
|
+
path: _path + ".block",
|
|
1202
|
+
expected: "string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">",
|
|
1203
|
+
value: input.block
|
|
1204
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
1205
|
+
path: _path + ".block",
|
|
1206
|
+
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1207
|
+
value: input.block
|
|
1208
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
682
1209
|
path: _path + ".offset",
|
|
683
|
-
expected: "number",
|
|
1210
|
+
expected: "number & Minimum<0>",
|
|
684
1211
|
value: input.offset
|
|
685
|
-
}, errorFactory)) && (0 <= input.offset || $guard(_exceptionable, {
|
|
1212
|
+
}, errorFactory)) && (Math.floor(input.offset) === input.offset && 0 <= input.offset && input.offset <= 4294967295 || $guard(_exceptionable, {
|
|
686
1213
|
path: _path + ".offset",
|
|
687
|
-
expected: "number &
|
|
1214
|
+
expected: "number & Type<\"uint32\">",
|
|
688
1215
|
value: input.offset
|
|
689
1216
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
690
1217
|
path: _path + ".offset",
|
|
691
|
-
expected: "((number & Minimum<0>) | null)",
|
|
1218
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
692
1219
|
value: input.offset
|
|
693
|
-
}, errorFactory)) && (null === input.
|
|
694
|
-
path: _path + ".position",
|
|
695
|
-
expected: "number",
|
|
696
|
-
value: input.position
|
|
697
|
-
}, errorFactory)) && (0 <= input.position || $guard(_exceptionable, {
|
|
698
|
-
path: _path + ".position",
|
|
699
|
-
expected: "number & Minimum<0>",
|
|
700
|
-
value: input.position
|
|
701
|
-
}, errorFactory)) || $guard(_exceptionable, {
|
|
702
|
-
path: _path + ".position",
|
|
703
|
-
expected: "((number & Minimum<0>) | null)",
|
|
704
|
-
value: input.position
|
|
705
|
-
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) || $guard(_exceptionable, {
|
|
1220
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
706
1221
|
path: _path + ".size",
|
|
707
|
-
expected: "number",
|
|
1222
|
+
expected: "number & Minimum<0>",
|
|
708
1223
|
value: input.size
|
|
709
|
-
}, errorFactory)) && (0 <= input.size || $guard(_exceptionable, {
|
|
1224
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295 || $guard(_exceptionable, {
|
|
710
1225
|
path: _path + ".size",
|
|
711
|
-
expected: "number &
|
|
1226
|
+
expected: "number & Type<\"uint32\">",
|
|
712
1227
|
value: input.size
|
|
713
1228
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
714
1229
|
path: _path + ".size",
|
|
715
|
-
expected: "((number & Minimum<0>) | null)",
|
|
1230
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
716
1231
|
value: input.size
|
|
717
1232
|
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
718
1233
|
path: _path + ".hash",
|
|
@@ -722,17 +1237,17 @@ export const assertStringifyBlocks = (input, errorFactory) => { const assert = (
|
|
|
722
1237
|
path: _path + ".hash",
|
|
723
1238
|
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
724
1239
|
value: input.hash
|
|
725
|
-
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (
|
|
1240
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
726
1241
|
path: _path + ".btime",
|
|
727
|
-
expected: "number",
|
|
1242
|
+
expected: "number & Minimum<0>",
|
|
728
1243
|
value: input.btime
|
|
729
|
-
}, errorFactory)) && (0 <= input.btime || $guard(_exceptionable, {
|
|
1244
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295 || $guard(_exceptionable, {
|
|
730
1245
|
path: _path + ".btime",
|
|
731
|
-
expected: "number &
|
|
1246
|
+
expected: "number & Type<\"uint32\">",
|
|
732
1247
|
value: input.btime
|
|
733
1248
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
734
1249
|
path: _path + ".btime",
|
|
735
|
-
expected: "((number & Minimum<0>) | null)",
|
|
1250
|
+
expected: "((number & Minimum<0> & Type<\"uint32\">) | null)",
|
|
736
1251
|
value: input.btime
|
|
737
1252
|
}, errorFactory));
|
|
738
1253
|
return (Array.isArray(input) || $guard(true, {
|
|
@@ -756,6 +1271,6 @@ export const assertStringifyBlocks = (input, errorFactory) => { const assert = (
|
|
|
756
1271
|
return input;
|
|
757
1272
|
}; const stringify = input => {
|
|
758
1273
|
const $string = __typia.json.createAssertStringify.string;
|
|
759
|
-
const $so0 = input => `{"
|
|
1274
|
+
const $so0 = input => `{"id":${$string(input.id)},"file":${$string(input.file)},"location":${$string(input.location)},"block":${$string(input.block)},"offset":${null !== input.offset ? input.offset : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
760
1275
|
return `[${input.map(elem => $so0(elem)).join(",")}]`;
|
|
761
1276
|
}; return stringify(assert(input, errorFactory)); };
|