@nxtedition/types 1.0.0 → 1.1.0
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 +8 -8
- package/dist/common/block.js +372 -182
- package/dist/common/file.d.ts +30 -0
- package/dist/common/file.js +592 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +1 -0
- package/dist/common/lock.d.ts +5 -3
- package/dist/common/lock.js +128 -42
- package/package.json +2 -1
package/dist/common/block.js
CHANGED
|
@@ -1,63 +1,79 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export const isBlock = input => {
|
|
3
|
-
const $io0 = input => "string" === typeof input.fileId &&
|
|
3
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && 0 <= input.offset) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (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);
|
|
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.fileId &&
|
|
8
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && 0 <= input.offset) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (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);
|
|
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.fileId || $guard(_exceptionable, {
|
|
14
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId && (1 <= input.fileId.length || $guard(_exceptionable, {
|
|
15
15
|
path: _path + ".fileId",
|
|
16
|
-
expected: "string",
|
|
16
|
+
expected: "string & MinLength<1>",
|
|
17
17
|
value: input.fileId
|
|
18
|
-
}, errorFactory))
|
|
18
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
19
|
+
path: _path + ".fileId",
|
|
20
|
+
expected: "(string & MinLength<1>)",
|
|
21
|
+
value: input.fileId
|
|
22
|
+
}, errorFactory)) && ("string" === typeof input.locationId && (1 <= input.locationId.length || $guard(_exceptionable, {
|
|
23
|
+
path: _path + ".locationId",
|
|
24
|
+
expected: "string & MinLength<1>",
|
|
25
|
+
value: input.locationId
|
|
26
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
19
27
|
path: _path + ".locationId",
|
|
20
|
-
expected: "string",
|
|
28
|
+
expected: "(string & MinLength<1>)",
|
|
21
29
|
value: input.locationId
|
|
22
|
-
}, errorFactory)) && ("string" === typeof input.blockId || $guard(_exceptionable, {
|
|
30
|
+
}, errorFactory)) && ("string" === typeof input.blockId && (1 <= input.blockId.length || $guard(_exceptionable, {
|
|
23
31
|
path: _path + ".blockId",
|
|
24
|
-
expected: "string",
|
|
32
|
+
expected: "string & MinLength<1>",
|
|
25
33
|
value: input.blockId
|
|
26
|
-
}, errorFactory))
|
|
34
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
|
+
path: _path + ".blockId",
|
|
36
|
+
expected: "(string & MinLength<1>)",
|
|
37
|
+
value: input.blockId
|
|
38
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
27
39
|
path: _path + ".offset",
|
|
28
|
-
expected: "number &
|
|
40
|
+
expected: "number & Minimum<0>",
|
|
29
41
|
value: input.offset
|
|
30
42
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
31
43
|
path: _path + ".offset",
|
|
32
|
-
expected: "((number &
|
|
44
|
+
expected: "((number & Minimum<0>) | null)",
|
|
33
45
|
value: input.offset
|
|
34
|
-
}, errorFactory)) && (
|
|
46
|
+
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
35
47
|
path: _path + ".position",
|
|
36
|
-
expected: "number &
|
|
48
|
+
expected: "number & Minimum<0>",
|
|
37
49
|
value: input.position
|
|
38
50
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
39
51
|
path: _path + ".position",
|
|
40
|
-
expected: "((number &
|
|
52
|
+
expected: "((number & Minimum<0>) | null)",
|
|
41
53
|
value: input.position
|
|
42
|
-
}, errorFactory)) && (
|
|
54
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
43
55
|
path: _path + ".size",
|
|
44
|
-
expected: "number &
|
|
56
|
+
expected: "number & Minimum<0>",
|
|
45
57
|
value: input.size
|
|
46
58
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
47
59
|
path: _path + ".size",
|
|
48
|
-
expected: "((number &
|
|
60
|
+
expected: "((number & Minimum<0>) | null)",
|
|
49
61
|
value: input.size
|
|
50
|
-
}, errorFactory)) && (
|
|
62
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
63
|
+
path: _path + ".hash",
|
|
64
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
65
|
+
value: input.hash
|
|
66
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
51
67
|
path: _path + ".hash",
|
|
52
|
-
expected: "(string |
|
|
68
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
53
69
|
value: input.hash
|
|
54
|
-
}, errorFactory)) && (
|
|
70
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
55
71
|
path: _path + ".btime",
|
|
56
|
-
expected: "number &
|
|
72
|
+
expected: "number & Minimum<0>",
|
|
57
73
|
value: input.btime
|
|
58
74
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
59
75
|
path: _path + ".btime",
|
|
60
|
-
expected: "((number &
|
|
76
|
+
expected: "((number & Minimum<0>) | null)",
|
|
61
77
|
value: input.btime
|
|
62
78
|
}, errorFactory));
|
|
63
79
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
@@ -76,111 +92,158 @@ export const randomBlock = generator => {
|
|
|
76
92
|
const $generator = __typia.createRandom.generator;
|
|
77
93
|
const $pick = __typia.createRandom.pick;
|
|
78
94
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
79
|
-
fileId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
fileId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
96
|
+
{
|
|
97
|
+
name: "MinLength<1>",
|
|
98
|
+
kind: "minLength",
|
|
99
|
+
value: 1
|
|
100
|
+
}
|
|
101
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
|
|
102
|
+
locationId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
103
|
+
{
|
|
104
|
+
name: "MinLength<1>",
|
|
105
|
+
kind: "minLength",
|
|
106
|
+
value: 1
|
|
107
|
+
}
|
|
108
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
|
|
109
|
+
blockId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
110
|
+
{
|
|
111
|
+
name: "MinLength<1>",
|
|
112
|
+
kind: "minLength",
|
|
113
|
+
value: 1
|
|
114
|
+
}
|
|
115
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
|
|
82
116
|
offset: $pick([
|
|
83
|
-
() =>
|
|
117
|
+
() => null,
|
|
84
118
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
85
119
|
{
|
|
86
|
-
name: "
|
|
87
|
-
kind: "
|
|
88
|
-
value:
|
|
120
|
+
name: "Minimum<0>",
|
|
121
|
+
kind: "minimum",
|
|
122
|
+
value: 0
|
|
89
123
|
}
|
|
90
|
-
]) ?? (generator?.
|
|
124
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
91
125
|
])(),
|
|
92
126
|
position: $pick([
|
|
93
|
-
() =>
|
|
127
|
+
() => null,
|
|
94
128
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
95
129
|
{
|
|
96
|
-
name: "
|
|
97
|
-
kind: "
|
|
98
|
-
value:
|
|
130
|
+
name: "Minimum<0>",
|
|
131
|
+
kind: "minimum",
|
|
132
|
+
value: 0
|
|
99
133
|
}
|
|
100
|
-
]) ?? (generator?.
|
|
134
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
101
135
|
])(),
|
|
102
136
|
size: $pick([
|
|
103
|
-
() =>
|
|
137
|
+
() => null,
|
|
104
138
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
105
139
|
{
|
|
106
|
-
name: "
|
|
107
|
-
kind: "
|
|
108
|
-
value:
|
|
140
|
+
name: "Minimum<0>",
|
|
141
|
+
kind: "minimum",
|
|
142
|
+
value: 0
|
|
109
143
|
}
|
|
110
|
-
]) ?? (generator?.
|
|
144
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
111
145
|
])(),
|
|
112
146
|
hash: $pick([
|
|
113
|
-
() =>
|
|
114
|
-
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
147
|
+
() => null,
|
|
148
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
149
|
+
{
|
|
150
|
+
name: "MaxLength<0>",
|
|
151
|
+
kind: "maxLength",
|
|
152
|
+
value: 0
|
|
153
|
+
}
|
|
154
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(0, 0)),
|
|
155
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
156
|
+
{
|
|
157
|
+
name: "Pattern<\"^[A-Fa-f0-9]{32}$\">",
|
|
158
|
+
kind: "pattern",
|
|
159
|
+
value: "^[A-Fa-f0-9]{32}$"
|
|
160
|
+
}
|
|
161
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[A-Fa-f0-9]{32}$/)
|
|
115
162
|
])(),
|
|
116
163
|
btime: $pick([
|
|
117
|
-
() =>
|
|
164
|
+
() => null,
|
|
118
165
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
119
166
|
{
|
|
120
|
-
name: "
|
|
121
|
-
kind: "
|
|
122
|
-
value:
|
|
167
|
+
name: "Minimum<0>",
|
|
168
|
+
kind: "minimum",
|
|
169
|
+
value: 0
|
|
123
170
|
}
|
|
124
|
-
]) ?? (generator?.
|
|
171
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
125
172
|
])()
|
|
126
173
|
});
|
|
127
174
|
return $ro0();
|
|
128
175
|
};
|
|
129
176
|
export const assertGuardBlock = (input, errorFactory) => {
|
|
130
177
|
const __is = input => {
|
|
131
|
-
const $io0 = input => "string" === typeof input.fileId &&
|
|
178
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && 0 <= input.offset) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (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);
|
|
132
179
|
return "object" === typeof input && null !== input && $io0(input);
|
|
133
180
|
};
|
|
134
181
|
if (false === __is(input))
|
|
135
182
|
((input, _path, _exceptionable = true) => {
|
|
136
183
|
const $guard = __typia.createAssertGuard.guard;
|
|
137
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId || $guard(_exceptionable, {
|
|
184
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId && (1 <= input.fileId.length || $guard(_exceptionable, {
|
|
185
|
+
path: _path + ".fileId",
|
|
186
|
+
expected: "string & MinLength<1>",
|
|
187
|
+
value: input.fileId
|
|
188
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
138
189
|
path: _path + ".fileId",
|
|
139
|
-
expected: "string",
|
|
190
|
+
expected: "(string & MinLength<1>)",
|
|
140
191
|
value: input.fileId
|
|
141
|
-
}, errorFactory)) && ("string" === typeof input.locationId || $guard(_exceptionable, {
|
|
192
|
+
}, errorFactory)) && ("string" === typeof input.locationId && (1 <= input.locationId.length || $guard(_exceptionable, {
|
|
193
|
+
path: _path + ".locationId",
|
|
194
|
+
expected: "string & MinLength<1>",
|
|
195
|
+
value: input.locationId
|
|
196
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
142
197
|
path: _path + ".locationId",
|
|
143
|
-
expected: "string",
|
|
198
|
+
expected: "(string & MinLength<1>)",
|
|
144
199
|
value: input.locationId
|
|
145
|
-
}, errorFactory)) && ("string" === typeof input.blockId || $guard(_exceptionable, {
|
|
200
|
+
}, errorFactory)) && ("string" === typeof input.blockId && (1 <= input.blockId.length || $guard(_exceptionable, {
|
|
201
|
+
path: _path + ".blockId",
|
|
202
|
+
expected: "string & MinLength<1>",
|
|
203
|
+
value: input.blockId
|
|
204
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
146
205
|
path: _path + ".blockId",
|
|
147
|
-
expected: "string",
|
|
206
|
+
expected: "(string & MinLength<1>)",
|
|
148
207
|
value: input.blockId
|
|
149
|
-
}, errorFactory)) && (
|
|
208
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
150
209
|
path: _path + ".offset",
|
|
151
|
-
expected: "number &
|
|
210
|
+
expected: "number & Minimum<0>",
|
|
152
211
|
value: input.offset
|
|
153
212
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
154
213
|
path: _path + ".offset",
|
|
155
|
-
expected: "((number &
|
|
214
|
+
expected: "((number & Minimum<0>) | null)",
|
|
156
215
|
value: input.offset
|
|
157
|
-
}, errorFactory)) && (
|
|
216
|
+
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
158
217
|
path: _path + ".position",
|
|
159
|
-
expected: "number &
|
|
218
|
+
expected: "number & Minimum<0>",
|
|
160
219
|
value: input.position
|
|
161
220
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
162
221
|
path: _path + ".position",
|
|
163
|
-
expected: "((number &
|
|
222
|
+
expected: "((number & Minimum<0>) | null)",
|
|
164
223
|
value: input.position
|
|
165
|
-
}, errorFactory)) && (
|
|
224
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
166
225
|
path: _path + ".size",
|
|
167
|
-
expected: "number &
|
|
226
|
+
expected: "number & Minimum<0>",
|
|
168
227
|
value: input.size
|
|
169
228
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
170
229
|
path: _path + ".size",
|
|
171
|
-
expected: "((number &
|
|
230
|
+
expected: "((number & Minimum<0>) | null)",
|
|
172
231
|
value: input.size
|
|
173
|
-
}, errorFactory)) && (
|
|
232
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
233
|
+
path: _path + ".hash",
|
|
234
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
235
|
+
value: input.hash
|
|
236
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
174
237
|
path: _path + ".hash",
|
|
175
|
-
expected: "(string |
|
|
238
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
176
239
|
value: input.hash
|
|
177
|
-
}, errorFactory)) && (
|
|
240
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
178
241
|
path: _path + ".btime",
|
|
179
|
-
expected: "number &
|
|
242
|
+
expected: "number & Minimum<0>",
|
|
180
243
|
value: input.btime
|
|
181
244
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
182
245
|
path: _path + ".btime",
|
|
183
|
-
expected: "((number &
|
|
246
|
+
expected: "((number & Minimum<0>) | null)",
|
|
184
247
|
value: input.btime
|
|
185
248
|
}, errorFactory));
|
|
186
249
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
@@ -196,64 +259,96 @@ export const assertGuardBlock = (input, errorFactory) => {
|
|
|
196
259
|
};
|
|
197
260
|
export const stringifyBlock = input => {
|
|
198
261
|
const $string = __typia.json.createStringify.string;
|
|
199
|
-
const $so0 = input => `{${
|
|
262
|
+
const $so0 = input => `{"fileId":${$string(input.fileId)},"locationId":${$string(input.locationId)},"blockId":${$string(input.blockId)},"offset":${null !== input.offset ? input.offset : "null"},"position":${null !== input.position ? input.position : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
200
263
|
return $so0(input);
|
|
201
264
|
};
|
|
202
265
|
export const assertStringifyBlock = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
203
266
|
const __is = input => {
|
|
204
|
-
const $io0 = input => "string" === typeof input.fileId && "string" === typeof input.locationId && "string" === typeof input.blockId && (
|
|
267
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && (!Number.isNaN(input.offset) && 0 <= input.offset)) && (null === input.position || "number" === typeof input.position && (!Number.isNaN(input.position) && 0 <= input.position)) && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) && 0 <= input.size)) && (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 && (!Number.isNaN(input.btime) && 0 <= input.btime));
|
|
205
268
|
return "object" === typeof input && null !== input && $io0(input);
|
|
206
269
|
};
|
|
207
270
|
if (false === __is(input))
|
|
208
271
|
((input, _path, _exceptionable = true) => {
|
|
209
272
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
210
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId || $guard(_exceptionable, {
|
|
273
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId && (1 <= input.fileId.length || $guard(_exceptionable, {
|
|
274
|
+
path: _path + ".fileId",
|
|
275
|
+
expected: "string & MinLength<1>",
|
|
276
|
+
value: input.fileId
|
|
277
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
211
278
|
path: _path + ".fileId",
|
|
212
|
-
expected: "string",
|
|
279
|
+
expected: "(string & MinLength<1>)",
|
|
213
280
|
value: input.fileId
|
|
214
|
-
}, errorFactory)) && ("string" === typeof input.locationId || $guard(_exceptionable, {
|
|
281
|
+
}, errorFactory)) && ("string" === typeof input.locationId && (1 <= input.locationId.length || $guard(_exceptionable, {
|
|
282
|
+
path: _path + ".locationId",
|
|
283
|
+
expected: "string & MinLength<1>",
|
|
284
|
+
value: input.locationId
|
|
285
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
215
286
|
path: _path + ".locationId",
|
|
216
|
-
expected: "string",
|
|
287
|
+
expected: "(string & MinLength<1>)",
|
|
217
288
|
value: input.locationId
|
|
218
|
-
}, errorFactory)) && ("string" === typeof input.blockId || $guard(_exceptionable, {
|
|
289
|
+
}, errorFactory)) && ("string" === typeof input.blockId && (1 <= input.blockId.length || $guard(_exceptionable, {
|
|
290
|
+
path: _path + ".blockId",
|
|
291
|
+
expected: "string & MinLength<1>",
|
|
292
|
+
value: input.blockId
|
|
293
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
219
294
|
path: _path + ".blockId",
|
|
220
|
-
expected: "string",
|
|
295
|
+
expected: "(string & MinLength<1>)",
|
|
221
296
|
value: input.blockId
|
|
222
|
-
}, errorFactory)) && (
|
|
297
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (!Number.isNaN(input.offset) || $guard(_exceptionable, {
|
|
298
|
+
path: _path + ".offset",
|
|
299
|
+
expected: "number",
|
|
300
|
+
value: input.offset
|
|
301
|
+
}, errorFactory)) && (0 <= input.offset || $guard(_exceptionable, {
|
|
223
302
|
path: _path + ".offset",
|
|
224
|
-
expected: "number &
|
|
303
|
+
expected: "number & Minimum<0>",
|
|
225
304
|
value: input.offset
|
|
226
305
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
227
306
|
path: _path + ".offset",
|
|
228
|
-
expected: "((number &
|
|
307
|
+
expected: "((number & Minimum<0>) | null)",
|
|
229
308
|
value: input.offset
|
|
230
|
-
}, errorFactory)) && (
|
|
309
|
+
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (!Number.isNaN(input.position) || $guard(_exceptionable, {
|
|
231
310
|
path: _path + ".position",
|
|
232
|
-
expected: "number
|
|
311
|
+
expected: "number",
|
|
312
|
+
value: input.position
|
|
313
|
+
}, errorFactory)) && (0 <= input.position || $guard(_exceptionable, {
|
|
314
|
+
path: _path + ".position",
|
|
315
|
+
expected: "number & Minimum<0>",
|
|
233
316
|
value: input.position
|
|
234
317
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
235
318
|
path: _path + ".position",
|
|
236
|
-
expected: "((number &
|
|
319
|
+
expected: "((number & Minimum<0>) | null)",
|
|
237
320
|
value: input.position
|
|
238
|
-
}, errorFactory)) && (
|
|
321
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) || $guard(_exceptionable, {
|
|
322
|
+
path: _path + ".size",
|
|
323
|
+
expected: "number",
|
|
324
|
+
value: input.size
|
|
325
|
+
}, errorFactory)) && (0 <= input.size || $guard(_exceptionable, {
|
|
239
326
|
path: _path + ".size",
|
|
240
|
-
expected: "number &
|
|
327
|
+
expected: "number & Minimum<0>",
|
|
241
328
|
value: input.size
|
|
242
329
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
243
330
|
path: _path + ".size",
|
|
244
|
-
expected: "((number &
|
|
331
|
+
expected: "((number & Minimum<0>) | null)",
|
|
245
332
|
value: input.size
|
|
246
|
-
}, errorFactory)) && (
|
|
333
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
334
|
+
path: _path + ".hash",
|
|
335
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
336
|
+
value: input.hash
|
|
337
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
247
338
|
path: _path + ".hash",
|
|
248
|
-
expected: "(string |
|
|
339
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
249
340
|
value: input.hash
|
|
250
|
-
}, errorFactory)) && (
|
|
341
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (!Number.isNaN(input.btime) || $guard(_exceptionable, {
|
|
342
|
+
path: _path + ".btime",
|
|
343
|
+
expected: "number",
|
|
344
|
+
value: input.btime
|
|
345
|
+
}, errorFactory)) && (0 <= input.btime || $guard(_exceptionable, {
|
|
251
346
|
path: _path + ".btime",
|
|
252
|
-
expected: "number &
|
|
347
|
+
expected: "number & Minimum<0>",
|
|
253
348
|
value: input.btime
|
|
254
349
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
255
350
|
path: _path + ".btime",
|
|
256
|
-
expected: "((number &
|
|
351
|
+
expected: "((number & Minimum<0>) | null)",
|
|
257
352
|
value: input.btime
|
|
258
353
|
}, errorFactory));
|
|
259
354
|
return ("object" === typeof input && null !== input || $guard(true, {
|
|
@@ -269,68 +364,84 @@ export const assertStringifyBlock = (input, errorFactory) => { const assert = (i
|
|
|
269
364
|
return input;
|
|
270
365
|
}; const stringify = input => {
|
|
271
366
|
const $string = __typia.json.createAssertStringify.string;
|
|
272
|
-
const $so0 = input => `{${
|
|
367
|
+
const $so0 = input => `{"fileId":${$string(input.fileId)},"locationId":${$string(input.locationId)},"blockId":${$string(input.blockId)},"offset":${null !== input.offset ? input.offset : "null"},"position":${null !== input.position ? input.position : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
273
368
|
return $so0(input);
|
|
274
369
|
}; return stringify(assert(input, errorFactory)); };
|
|
275
370
|
export const isBlocks = input => {
|
|
276
|
-
const $io0 = input => "string" === typeof input.fileId &&
|
|
371
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && 0 <= input.offset) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (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);
|
|
277
372
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
278
373
|
};
|
|
279
374
|
export const assertBlocks = (input, errorFactory) => {
|
|
280
375
|
const __is = input => {
|
|
281
|
-
const $io0 = input => "string" === typeof input.fileId &&
|
|
376
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && 0 <= input.offset) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (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);
|
|
282
377
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
283
378
|
};
|
|
284
379
|
if (false === __is(input))
|
|
285
380
|
((input, _path, _exceptionable = true) => {
|
|
286
381
|
const $guard = __typia.createAssert.guard;
|
|
287
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId || $guard(_exceptionable, {
|
|
382
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId && (1 <= input.fileId.length || $guard(_exceptionable, {
|
|
288
383
|
path: _path + ".fileId",
|
|
289
|
-
expected: "string",
|
|
384
|
+
expected: "string & MinLength<1>",
|
|
290
385
|
value: input.fileId
|
|
291
|
-
}, errorFactory))
|
|
386
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
387
|
+
path: _path + ".fileId",
|
|
388
|
+
expected: "(string & MinLength<1>)",
|
|
389
|
+
value: input.fileId
|
|
390
|
+
}, errorFactory)) && ("string" === typeof input.locationId && (1 <= input.locationId.length || $guard(_exceptionable, {
|
|
391
|
+
path: _path + ".locationId",
|
|
392
|
+
expected: "string & MinLength<1>",
|
|
393
|
+
value: input.locationId
|
|
394
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
292
395
|
path: _path + ".locationId",
|
|
293
|
-
expected: "string",
|
|
396
|
+
expected: "(string & MinLength<1>)",
|
|
294
397
|
value: input.locationId
|
|
295
|
-
}, errorFactory)) && ("string" === typeof input.blockId || $guard(_exceptionable, {
|
|
398
|
+
}, errorFactory)) && ("string" === typeof input.blockId && (1 <= input.blockId.length || $guard(_exceptionable, {
|
|
296
399
|
path: _path + ".blockId",
|
|
297
|
-
expected: "string",
|
|
400
|
+
expected: "string & MinLength<1>",
|
|
298
401
|
value: input.blockId
|
|
299
|
-
}, errorFactory))
|
|
402
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
403
|
+
path: _path + ".blockId",
|
|
404
|
+
expected: "(string & MinLength<1>)",
|
|
405
|
+
value: input.blockId
|
|
406
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
300
407
|
path: _path + ".offset",
|
|
301
|
-
expected: "number &
|
|
408
|
+
expected: "number & Minimum<0>",
|
|
302
409
|
value: input.offset
|
|
303
410
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
304
411
|
path: _path + ".offset",
|
|
305
|
-
expected: "((number &
|
|
412
|
+
expected: "((number & Minimum<0>) | null)",
|
|
306
413
|
value: input.offset
|
|
307
|
-
}, errorFactory)) && (
|
|
414
|
+
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
308
415
|
path: _path + ".position",
|
|
309
|
-
expected: "number &
|
|
416
|
+
expected: "number & Minimum<0>",
|
|
310
417
|
value: input.position
|
|
311
418
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
312
419
|
path: _path + ".position",
|
|
313
|
-
expected: "((number &
|
|
420
|
+
expected: "((number & Minimum<0>) | null)",
|
|
314
421
|
value: input.position
|
|
315
|
-
}, errorFactory)) && (
|
|
422
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
316
423
|
path: _path + ".size",
|
|
317
|
-
expected: "number &
|
|
424
|
+
expected: "number & Minimum<0>",
|
|
318
425
|
value: input.size
|
|
319
426
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
320
427
|
path: _path + ".size",
|
|
321
|
-
expected: "((number &
|
|
428
|
+
expected: "((number & Minimum<0>) | null)",
|
|
322
429
|
value: input.size
|
|
323
|
-
}, errorFactory)) && (
|
|
430
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
431
|
+
path: _path + ".hash",
|
|
432
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
433
|
+
value: input.hash
|
|
434
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
324
435
|
path: _path + ".hash",
|
|
325
|
-
expected: "(string |
|
|
436
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
326
437
|
value: input.hash
|
|
327
|
-
}, errorFactory)) && (
|
|
438
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
328
439
|
path: _path + ".btime",
|
|
329
|
-
expected: "number &
|
|
440
|
+
expected: "number & Minimum<0>",
|
|
330
441
|
value: input.btime
|
|
331
442
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
332
443
|
path: _path + ".btime",
|
|
333
|
-
expected: "((number &
|
|
444
|
+
expected: "((number & Minimum<0>) | null)",
|
|
334
445
|
value: input.btime
|
|
335
446
|
}, errorFactory));
|
|
336
447
|
return (Array.isArray(input) || $guard(true, {
|
|
@@ -357,111 +468,158 @@ export const randomBlocks = generator => {
|
|
|
357
468
|
const $generator = __typia.createRandom.generator;
|
|
358
469
|
const $pick = __typia.createRandom.pick;
|
|
359
470
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
360
|
-
fileId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
361
|
-
|
|
362
|
-
|
|
471
|
+
fileId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
472
|
+
{
|
|
473
|
+
name: "MinLength<1>",
|
|
474
|
+
kind: "minLength",
|
|
475
|
+
value: 1
|
|
476
|
+
}
|
|
477
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
|
|
478
|
+
locationId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
479
|
+
{
|
|
480
|
+
name: "MinLength<1>",
|
|
481
|
+
kind: "minLength",
|
|
482
|
+
value: 1
|
|
483
|
+
}
|
|
484
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
|
|
485
|
+
blockId: (generator?.customs ?? $generator.customs)?.string?.([
|
|
486
|
+
{
|
|
487
|
+
name: "MinLength<1>",
|
|
488
|
+
kind: "minLength",
|
|
489
|
+
value: 1
|
|
490
|
+
}
|
|
491
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
|
|
363
492
|
offset: $pick([
|
|
364
|
-
() =>
|
|
493
|
+
() => null,
|
|
365
494
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
366
495
|
{
|
|
367
|
-
name: "
|
|
368
|
-
kind: "
|
|
369
|
-
value:
|
|
496
|
+
name: "Minimum<0>",
|
|
497
|
+
kind: "minimum",
|
|
498
|
+
value: 0
|
|
370
499
|
}
|
|
371
|
-
]) ?? (generator?.
|
|
500
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
372
501
|
])(),
|
|
373
502
|
position: $pick([
|
|
374
|
-
() =>
|
|
503
|
+
() => null,
|
|
375
504
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
376
505
|
{
|
|
377
|
-
name: "
|
|
378
|
-
kind: "
|
|
379
|
-
value:
|
|
506
|
+
name: "Minimum<0>",
|
|
507
|
+
kind: "minimum",
|
|
508
|
+
value: 0
|
|
380
509
|
}
|
|
381
|
-
]) ?? (generator?.
|
|
510
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
382
511
|
])(),
|
|
383
512
|
size: $pick([
|
|
384
|
-
() =>
|
|
513
|
+
() => null,
|
|
385
514
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
386
515
|
{
|
|
387
|
-
name: "
|
|
388
|
-
kind: "
|
|
389
|
-
value:
|
|
516
|
+
name: "Minimum<0>",
|
|
517
|
+
kind: "minimum",
|
|
518
|
+
value: 0
|
|
390
519
|
}
|
|
391
|
-
]) ?? (generator?.
|
|
520
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
392
521
|
])(),
|
|
393
522
|
hash: $pick([
|
|
394
|
-
() =>
|
|
395
|
-
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
523
|
+
() => null,
|
|
524
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
525
|
+
{
|
|
526
|
+
name: "MaxLength<0>",
|
|
527
|
+
kind: "maxLength",
|
|
528
|
+
value: 0
|
|
529
|
+
}
|
|
530
|
+
]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(0, 0)),
|
|
531
|
+
() => (generator?.customs ?? $generator.customs)?.string?.([
|
|
532
|
+
{
|
|
533
|
+
name: "Pattern<\"^[A-Fa-f0-9]{32}$\">",
|
|
534
|
+
kind: "pattern",
|
|
535
|
+
value: "^[A-Fa-f0-9]{32}$"
|
|
536
|
+
}
|
|
537
|
+
]) ?? (generator?.pattern ?? $generator.pattern)(/^[A-Fa-f0-9]{32}$/)
|
|
396
538
|
])(),
|
|
397
539
|
btime: $pick([
|
|
398
|
-
() =>
|
|
540
|
+
() => null,
|
|
399
541
|
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
400
542
|
{
|
|
401
|
-
name: "
|
|
402
|
-
kind: "
|
|
403
|
-
value:
|
|
543
|
+
name: "Minimum<0>",
|
|
544
|
+
kind: "minimum",
|
|
545
|
+
value: 0
|
|
404
546
|
}
|
|
405
|
-
]) ?? (generator?.
|
|
547
|
+
]) ?? (generator?.number ?? $generator.number)(0, 10)
|
|
406
548
|
])()
|
|
407
549
|
});
|
|
408
550
|
return (generator?.array ?? $generator.array)(() => $ro0());
|
|
409
551
|
};
|
|
410
552
|
export const assertGuardBlocks = (input, errorFactory) => {
|
|
411
553
|
const __is = input => {
|
|
412
|
-
const $io0 = input => "string" === typeof input.fileId &&
|
|
554
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && 0 <= input.offset) && (null === input.position || "number" === typeof input.position && 0 <= input.position) && (null === input.size || "number" === typeof input.size && 0 <= input.size) && (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);
|
|
413
555
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
414
556
|
};
|
|
415
557
|
if (false === __is(input))
|
|
416
558
|
((input, _path, _exceptionable = true) => {
|
|
417
559
|
const $guard = __typia.createAssertGuard.guard;
|
|
418
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId || $guard(_exceptionable, {
|
|
560
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId && (1 <= input.fileId.length || $guard(_exceptionable, {
|
|
561
|
+
path: _path + ".fileId",
|
|
562
|
+
expected: "string & MinLength<1>",
|
|
563
|
+
value: input.fileId
|
|
564
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
419
565
|
path: _path + ".fileId",
|
|
420
|
-
expected: "string",
|
|
566
|
+
expected: "(string & MinLength<1>)",
|
|
421
567
|
value: input.fileId
|
|
422
|
-
}, errorFactory)) && ("string" === typeof input.locationId || $guard(_exceptionable, {
|
|
568
|
+
}, errorFactory)) && ("string" === typeof input.locationId && (1 <= input.locationId.length || $guard(_exceptionable, {
|
|
569
|
+
path: _path + ".locationId",
|
|
570
|
+
expected: "string & MinLength<1>",
|
|
571
|
+
value: input.locationId
|
|
572
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
423
573
|
path: _path + ".locationId",
|
|
424
|
-
expected: "string",
|
|
574
|
+
expected: "(string & MinLength<1>)",
|
|
425
575
|
value: input.locationId
|
|
426
|
-
}, errorFactory)) && ("string" === typeof input.blockId || $guard(_exceptionable, {
|
|
576
|
+
}, errorFactory)) && ("string" === typeof input.blockId && (1 <= input.blockId.length || $guard(_exceptionable, {
|
|
577
|
+
path: _path + ".blockId",
|
|
578
|
+
expected: "string & MinLength<1>",
|
|
579
|
+
value: input.blockId
|
|
580
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
427
581
|
path: _path + ".blockId",
|
|
428
|
-
expected: "string",
|
|
582
|
+
expected: "(string & MinLength<1>)",
|
|
429
583
|
value: input.blockId
|
|
430
|
-
}, errorFactory)) && (
|
|
584
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (0 <= input.offset || $guard(_exceptionable, {
|
|
431
585
|
path: _path + ".offset",
|
|
432
|
-
expected: "number &
|
|
586
|
+
expected: "number & Minimum<0>",
|
|
433
587
|
value: input.offset
|
|
434
588
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
435
589
|
path: _path + ".offset",
|
|
436
|
-
expected: "((number &
|
|
590
|
+
expected: "((number & Minimum<0>) | null)",
|
|
437
591
|
value: input.offset
|
|
438
|
-
}, errorFactory)) && (
|
|
592
|
+
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
439
593
|
path: _path + ".position",
|
|
440
|
-
expected: "number &
|
|
594
|
+
expected: "number & Minimum<0>",
|
|
441
595
|
value: input.position
|
|
442
596
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
443
597
|
path: _path + ".position",
|
|
444
|
-
expected: "((number &
|
|
598
|
+
expected: "((number & Minimum<0>) | null)",
|
|
445
599
|
value: input.position
|
|
446
|
-
}, errorFactory)) && (
|
|
600
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
447
601
|
path: _path + ".size",
|
|
448
|
-
expected: "number &
|
|
602
|
+
expected: "number & Minimum<0>",
|
|
449
603
|
value: input.size
|
|
450
604
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
451
605
|
path: _path + ".size",
|
|
452
|
-
expected: "((number &
|
|
606
|
+
expected: "((number & Minimum<0>) | null)",
|
|
453
607
|
value: input.size
|
|
454
|
-
}, errorFactory)) && (
|
|
608
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
609
|
+
path: _path + ".hash",
|
|
610
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
611
|
+
value: input.hash
|
|
612
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
455
613
|
path: _path + ".hash",
|
|
456
|
-
expected: "(string |
|
|
614
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
457
615
|
value: input.hash
|
|
458
|
-
}, errorFactory)) && (
|
|
616
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
459
617
|
path: _path + ".btime",
|
|
460
|
-
expected: "number &
|
|
618
|
+
expected: "number & Minimum<0>",
|
|
461
619
|
value: input.btime
|
|
462
620
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
463
621
|
path: _path + ".btime",
|
|
464
|
-
expected: "((number &
|
|
622
|
+
expected: "((number & Minimum<0>) | null)",
|
|
465
623
|
value: input.btime
|
|
466
624
|
}, errorFactory));
|
|
467
625
|
return (Array.isArray(input) || $guard(true, {
|
|
@@ -485,64 +643,96 @@ export const assertGuardBlocks = (input, errorFactory) => {
|
|
|
485
643
|
};
|
|
486
644
|
export const stringifyBlocks = input => {
|
|
487
645
|
const $string = __typia.json.createStringify.string;
|
|
488
|
-
const $so0 = input => `{${
|
|
646
|
+
const $so0 = input => `{"fileId":${$string(input.fileId)},"locationId":${$string(input.locationId)},"blockId":${$string(input.blockId)},"offset":${null !== input.offset ? input.offset : "null"},"position":${null !== input.position ? input.position : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
489
647
|
return `[${input.map(elem => $so0(elem)).join(",")}]`;
|
|
490
648
|
};
|
|
491
649
|
export const assertStringifyBlocks = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
492
650
|
const __is = input => {
|
|
493
|
-
const $io0 = input => "string" === typeof input.fileId && "string" === typeof input.locationId && "string" === typeof input.blockId && (
|
|
651
|
+
const $io0 = input => "string" === typeof input.fileId && 1 <= input.fileId.length && ("string" === typeof input.locationId && 1 <= input.locationId.length) && ("string" === typeof input.blockId && 1 <= input.blockId.length) && (null === input.offset || "number" === typeof input.offset && (!Number.isNaN(input.offset) && 0 <= input.offset)) && (null === input.position || "number" === typeof input.position && (!Number.isNaN(input.position) && 0 <= input.position)) && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) && 0 <= input.size)) && (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 && (!Number.isNaN(input.btime) && 0 <= input.btime));
|
|
494
652
|
return Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && $io0(elem));
|
|
495
653
|
};
|
|
496
654
|
if (false === __is(input))
|
|
497
655
|
((input, _path, _exceptionable = true) => {
|
|
498
656
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
499
|
-
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId || $guard(_exceptionable, {
|
|
657
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.fileId && (1 <= input.fileId.length || $guard(_exceptionable, {
|
|
658
|
+
path: _path + ".fileId",
|
|
659
|
+
expected: "string & MinLength<1>",
|
|
660
|
+
value: input.fileId
|
|
661
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
500
662
|
path: _path + ".fileId",
|
|
501
|
-
expected: "string",
|
|
663
|
+
expected: "(string & MinLength<1>)",
|
|
502
664
|
value: input.fileId
|
|
503
|
-
}, errorFactory)) && ("string" === typeof input.locationId || $guard(_exceptionable, {
|
|
665
|
+
}, errorFactory)) && ("string" === typeof input.locationId && (1 <= input.locationId.length || $guard(_exceptionable, {
|
|
666
|
+
path: _path + ".locationId",
|
|
667
|
+
expected: "string & MinLength<1>",
|
|
668
|
+
value: input.locationId
|
|
669
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
504
670
|
path: _path + ".locationId",
|
|
505
|
-
expected: "string",
|
|
671
|
+
expected: "(string & MinLength<1>)",
|
|
506
672
|
value: input.locationId
|
|
507
|
-
}, errorFactory)) && ("string" === typeof input.blockId || $guard(_exceptionable, {
|
|
673
|
+
}, errorFactory)) && ("string" === typeof input.blockId && (1 <= input.blockId.length || $guard(_exceptionable, {
|
|
674
|
+
path: _path + ".blockId",
|
|
675
|
+
expected: "string & MinLength<1>",
|
|
676
|
+
value: input.blockId
|
|
677
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
508
678
|
path: _path + ".blockId",
|
|
509
|
-
expected: "string",
|
|
679
|
+
expected: "(string & MinLength<1>)",
|
|
510
680
|
value: input.blockId
|
|
511
|
-
}, errorFactory)) && (
|
|
681
|
+
}, errorFactory)) && (null === input.offset || "number" === typeof input.offset && (!Number.isNaN(input.offset) || $guard(_exceptionable, {
|
|
682
|
+
path: _path + ".offset",
|
|
683
|
+
expected: "number",
|
|
684
|
+
value: input.offset
|
|
685
|
+
}, errorFactory)) && (0 <= input.offset || $guard(_exceptionable, {
|
|
512
686
|
path: _path + ".offset",
|
|
513
|
-
expected: "number &
|
|
687
|
+
expected: "number & Minimum<0>",
|
|
514
688
|
value: input.offset
|
|
515
689
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
516
690
|
path: _path + ".offset",
|
|
517
|
-
expected: "((number &
|
|
691
|
+
expected: "((number & Minimum<0>) | null)",
|
|
518
692
|
value: input.offset
|
|
519
|
-
}, errorFactory)) && (
|
|
693
|
+
}, errorFactory)) && (null === input.position || "number" === typeof input.position && (!Number.isNaN(input.position) || $guard(_exceptionable, {
|
|
520
694
|
path: _path + ".position",
|
|
521
|
-
expected: "number
|
|
695
|
+
expected: "number",
|
|
696
|
+
value: input.position
|
|
697
|
+
}, errorFactory)) && (0 <= input.position || $guard(_exceptionable, {
|
|
698
|
+
path: _path + ".position",
|
|
699
|
+
expected: "number & Minimum<0>",
|
|
522
700
|
value: input.position
|
|
523
701
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
524
702
|
path: _path + ".position",
|
|
525
|
-
expected: "((number &
|
|
703
|
+
expected: "((number & Minimum<0>) | null)",
|
|
526
704
|
value: input.position
|
|
527
|
-
}, errorFactory)) && (
|
|
705
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (!Number.isNaN(input.size) || $guard(_exceptionable, {
|
|
706
|
+
path: _path + ".size",
|
|
707
|
+
expected: "number",
|
|
708
|
+
value: input.size
|
|
709
|
+
}, errorFactory)) && (0 <= input.size || $guard(_exceptionable, {
|
|
528
710
|
path: _path + ".size",
|
|
529
|
-
expected: "number &
|
|
711
|
+
expected: "number & Minimum<0>",
|
|
530
712
|
value: input.size
|
|
531
713
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
532
714
|
path: _path + ".size",
|
|
533
|
-
expected: "((number &
|
|
715
|
+
expected: "((number & Minimum<0>) | null)",
|
|
534
716
|
value: input.size
|
|
535
|
-
}, errorFactory)) && (
|
|
717
|
+
}, errorFactory)) && (null === input.hash || "string" === typeof input.hash && (input.hash.length <= 0 || /^[A-Fa-f0-9]{32}$/.test(input.hash) || $guard(_exceptionable, {
|
|
718
|
+
path: _path + ".hash",
|
|
719
|
+
expected: "(string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">))",
|
|
720
|
+
value: input.hash
|
|
721
|
+
}, errorFactory)) || $guard(_exceptionable, {
|
|
536
722
|
path: _path + ".hash",
|
|
537
|
-
expected: "(string |
|
|
723
|
+
expected: "((string & (MaxLength<0> | Pattern<\"^[A-Fa-f0-9]{32}$\">)) | null)",
|
|
538
724
|
value: input.hash
|
|
539
|
-
}, errorFactory)) && (
|
|
725
|
+
}, errorFactory)) && (null === input.btime || "number" === typeof input.btime && (!Number.isNaN(input.btime) || $guard(_exceptionable, {
|
|
726
|
+
path: _path + ".btime",
|
|
727
|
+
expected: "number",
|
|
728
|
+
value: input.btime
|
|
729
|
+
}, errorFactory)) && (0 <= input.btime || $guard(_exceptionable, {
|
|
540
730
|
path: _path + ".btime",
|
|
541
|
-
expected: "number &
|
|
731
|
+
expected: "number & Minimum<0>",
|
|
542
732
|
value: input.btime
|
|
543
733
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
544
734
|
path: _path + ".btime",
|
|
545
|
-
expected: "((number &
|
|
735
|
+
expected: "((number & Minimum<0>) | null)",
|
|
546
736
|
value: input.btime
|
|
547
737
|
}, errorFactory));
|
|
548
738
|
return (Array.isArray(input) || $guard(true, {
|
|
@@ -566,6 +756,6 @@ export const assertStringifyBlocks = (input, errorFactory) => { const assert = (
|
|
|
566
756
|
return input;
|
|
567
757
|
}; const stringify = input => {
|
|
568
758
|
const $string = __typia.json.createAssertStringify.string;
|
|
569
|
-
const $so0 = input => `{${
|
|
759
|
+
const $so0 = input => `{"fileId":${$string(input.fileId)},"locationId":${$string(input.locationId)},"blockId":${$string(input.blockId)},"offset":${null !== input.offset ? input.offset : "null"},"position":${null !== input.position ? input.position : "null"},"size":${null !== input.size ? input.size : "null"},"hash":${null !== input.hash ? $string(input.hash) : "null"},"btime":${null !== input.btime ? input.btime : "null"}}`;
|
|
570
760
|
return `[${input.map(elem => $so0(elem)).join(",")}]`;
|
|
571
761
|
}; return stringify(assert(input, errorFactory)); };
|