@nxtedition/types 1.2.1 → 1.2.3
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 +6 -6
- package/dist/common/block.js +276 -407
- package/dist/common/file.d.ts +4 -5
- package/dist/common/file.js +109 -153
- package/package.json +1 -1
package/dist/common/file.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export const isFile = input => {
|
|
3
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
4
4
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
5
5
|
const $io2 = input => "string" === typeof input.message;
|
|
6
6
|
return "object" === typeof input && null !== input && $io0(input);
|
|
7
7
|
};
|
|
8
8
|
export const assertFile = (input, errorFactory) => {
|
|
9
9
|
const __is = input => {
|
|
10
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (
|
|
10
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
11
11
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
12
12
|
const $io2 = input => "string" === typeof input.message;
|
|
13
13
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -23,7 +23,7 @@ export const assertFile = (input, errorFactory) => {
|
|
|
23
23
|
path: _path + ".id",
|
|
24
24
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
25
25
|
value: input.id
|
|
26
|
-
}, errorFactory)) && (
|
|
26
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
27
27
|
path: _path + ".size",
|
|
28
28
|
expected: "number & Minimum<0>",
|
|
29
29
|
value: input.size
|
|
@@ -33,7 +33,7 @@ export const assertFile = (input, errorFactory) => {
|
|
|
33
33
|
value: input.size
|
|
34
34
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
35
|
path: _path + ".size",
|
|
36
|
-
expected: "(
|
|
36
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
37
37
|
value: input.size
|
|
38
38
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
39
39
|
path: _path + ".seekable",
|
|
@@ -43,10 +43,6 @@ export const assertFile = (input, errorFactory) => {
|
|
|
43
43
|
path: _path + ".deleted",
|
|
44
44
|
expected: "boolean",
|
|
45
45
|
value: input.deleted
|
|
46
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
47
|
-
path: _path + ".path",
|
|
48
|
-
expected: "string",
|
|
49
|
-
value: input.path
|
|
50
46
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
51
47
|
path: _path + ".refs",
|
|
52
48
|
expected: "Array<__type>",
|
|
@@ -107,7 +103,7 @@ export const assertFile = (input, errorFactory) => {
|
|
|
107
103
|
path: _path + ".hash",
|
|
108
104
|
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
109
105
|
value: input.hash
|
|
110
|
-
}, errorFactory)) && (
|
|
106
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
111
107
|
path: _path + ".btime",
|
|
112
108
|
expected: "number & Minimum<0>",
|
|
113
109
|
value: input.btime
|
|
@@ -117,7 +113,7 @@ export const assertFile = (input, errorFactory) => {
|
|
|
117
113
|
value: input.btime
|
|
118
114
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
119
115
|
path: _path + ".btime",
|
|
120
|
-
expected: "(
|
|
116
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
121
117
|
value: input.btime
|
|
122
118
|
}, errorFactory));
|
|
123
119
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -153,24 +149,20 @@ export const randomFile = generator => {
|
|
|
153
149
|
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
154
150
|
}
|
|
155
151
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
156
|
-
size: $
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
170
|
-
])(),
|
|
152
|
+
size: (generator?.customs ?? $generator.customs)?.number?.([
|
|
153
|
+
{
|
|
154
|
+
name: "Minimum<0>",
|
|
155
|
+
kind: "minimum",
|
|
156
|
+
value: 0
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "Type<\"uint32\">",
|
|
160
|
+
kind: "type",
|
|
161
|
+
value: "uint32"
|
|
162
|
+
}
|
|
163
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
171
164
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
172
165
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
173
|
-
path: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
174
166
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
175
167
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
176
168
|
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
@@ -183,21 +175,18 @@ export const randomFile = generator => {
|
|
|
183
175
|
value: "^([A-Fa-f0-9]{32})?$"
|
|
184
176
|
}
|
|
185
177
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
|
|
186
|
-
btime: $
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
200
|
-
])()
|
|
178
|
+
btime: (generator?.customs ?? $generator.customs)?.number?.([
|
|
179
|
+
{
|
|
180
|
+
name: "Minimum<0>",
|
|
181
|
+
kind: "minimum",
|
|
182
|
+
value: 0
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "Type<\"uint32\">",
|
|
186
|
+
kind: "type",
|
|
187
|
+
value: "uint32"
|
|
188
|
+
}
|
|
189
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
201
190
|
});
|
|
202
191
|
const $ro1 = (_recursive = false, _depth = 0) => ({
|
|
203
192
|
file: $pick([
|
|
@@ -212,7 +201,7 @@ export const randomFile = generator => {
|
|
|
212
201
|
};
|
|
213
202
|
export const assertGuardFile = (input, errorFactory) => {
|
|
214
203
|
const __is = input => {
|
|
215
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (
|
|
204
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
216
205
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
217
206
|
const $io2 = input => "string" === typeof input.message;
|
|
218
207
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -228,7 +217,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
228
217
|
path: _path + ".id",
|
|
229
218
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
230
219
|
value: input.id
|
|
231
|
-
}, errorFactory)) && (
|
|
220
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
232
221
|
path: _path + ".size",
|
|
233
222
|
expected: "number & Minimum<0>",
|
|
234
223
|
value: input.size
|
|
@@ -238,7 +227,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
238
227
|
value: input.size
|
|
239
228
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
240
229
|
path: _path + ".size",
|
|
241
|
-
expected: "(
|
|
230
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
242
231
|
value: input.size
|
|
243
232
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
244
233
|
path: _path + ".seekable",
|
|
@@ -248,10 +237,6 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
248
237
|
path: _path + ".deleted",
|
|
249
238
|
expected: "boolean",
|
|
250
239
|
value: input.deleted
|
|
251
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
252
|
-
path: _path + ".path",
|
|
253
|
-
expected: "string",
|
|
254
|
-
value: input.path
|
|
255
240
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
256
241
|
path: _path + ".refs",
|
|
257
242
|
expected: "Array<__type>",
|
|
@@ -312,7 +297,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
312
297
|
path: _path + ".hash",
|
|
313
298
|
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
314
299
|
value: input.hash
|
|
315
|
-
}, errorFactory)) && (
|
|
300
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
316
301
|
path: _path + ".btime",
|
|
317
302
|
expected: "number & Minimum<0>",
|
|
318
303
|
value: input.btime
|
|
@@ -322,7 +307,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
322
307
|
value: input.btime
|
|
323
308
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
324
309
|
path: _path + ".btime",
|
|
325
|
-
expected: "(
|
|
310
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
326
311
|
value: input.btime
|
|
327
312
|
}, errorFactory));
|
|
328
313
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -351,13 +336,13 @@ export const stringifyFile = input => {
|
|
|
351
336
|
const $io2 = input => "string" === typeof input.message;
|
|
352
337
|
const $string = __typia.json.createStringify.string;
|
|
353
338
|
const $tail = __typia.json.createStringify.tail;
|
|
354
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${
|
|
339
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
355
340
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
356
341
|
return $so0(input);
|
|
357
342
|
};
|
|
358
343
|
export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
359
344
|
const __is = input => {
|
|
360
|
-
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (
|
|
345
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
361
346
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
362
347
|
const $io2 = input => "string" === typeof input.message;
|
|
363
348
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -373,7 +358,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
373
358
|
path: _path + ".id",
|
|
374
359
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
375
360
|
value: input.id
|
|
376
|
-
}, errorFactory)) && (
|
|
361
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
377
362
|
path: _path + ".size",
|
|
378
363
|
expected: "number & Minimum<0>",
|
|
379
364
|
value: input.size
|
|
@@ -383,7 +368,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
383
368
|
value: input.size
|
|
384
369
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
385
370
|
path: _path + ".size",
|
|
386
|
-
expected: "(
|
|
371
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
387
372
|
value: input.size
|
|
388
373
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
389
374
|
path: _path + ".seekable",
|
|
@@ -393,10 +378,6 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
393
378
|
path: _path + ".deleted",
|
|
394
379
|
expected: "boolean",
|
|
395
380
|
value: input.deleted
|
|
396
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
397
|
-
path: _path + ".path",
|
|
398
|
-
expected: "string",
|
|
399
|
-
value: input.path
|
|
400
381
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
401
382
|
path: _path + ".refs",
|
|
402
383
|
expected: "Array<__type>",
|
|
@@ -457,7 +438,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
457
438
|
path: _path + ".hash",
|
|
458
439
|
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
459
440
|
value: input.hash
|
|
460
|
-
}, errorFactory)) && (
|
|
441
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
461
442
|
path: _path + ".btime",
|
|
462
443
|
expected: "number & Minimum<0>",
|
|
463
444
|
value: input.btime
|
|
@@ -467,7 +448,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
467
448
|
value: input.btime
|
|
468
449
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
469
450
|
path: _path + ".btime",
|
|
470
|
-
expected: "(
|
|
451
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
471
452
|
value: input.btime
|
|
472
453
|
}, errorFactory));
|
|
473
454
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -496,19 +477,19 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
496
477
|
const $io2 = input => "string" === typeof input.message;
|
|
497
478
|
const $string = __typia.json.createAssertStringify.string;
|
|
498
479
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
499
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${
|
|
480
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
500
481
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
501
482
|
return $so0(input);
|
|
502
483
|
}; return stringify(assert(input, errorFactory)); };
|
|
503
484
|
export const isFileStats = input => {
|
|
504
|
-
const $io0 = input =>
|
|
485
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
505
486
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
506
487
|
const $io2 = input => "string" === typeof input.message;
|
|
507
488
|
return "object" === typeof input && null !== input && $io0(input);
|
|
508
489
|
};
|
|
509
490
|
export const assertFileStats = (input, errorFactory) => {
|
|
510
491
|
const __is = input => {
|
|
511
|
-
const $io0 = input =>
|
|
492
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
512
493
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
513
494
|
const $io2 = input => "string" === typeof input.message;
|
|
514
495
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -516,7 +497,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
516
497
|
if (false === __is(input))
|
|
517
498
|
((input, _path, _exceptionable = true) => {
|
|
518
499
|
const $guard = __typia.createAssert.guard;
|
|
519
|
-
const $ao0 = (input, _path, _exceptionable = true) => (
|
|
500
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
520
501
|
path: _path + ".position",
|
|
521
502
|
expected: "number & Minimum<0>",
|
|
522
503
|
value: input.position
|
|
@@ -526,11 +507,11 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
526
507
|
value: input.position
|
|
527
508
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
528
509
|
path: _path + ".position",
|
|
529
|
-
expected: "(
|
|
510
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
530
511
|
value: input.position
|
|
531
|
-
}, errorFactory)) && (
|
|
512
|
+
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
532
513
|
path: _path + ".uploading",
|
|
533
|
-
expected: "
|
|
514
|
+
expected: "boolean",
|
|
534
515
|
value: input.uploading
|
|
535
516
|
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
536
517
|
path: _path + ".completed",
|
|
@@ -568,7 +549,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
568
549
|
path: _path + ".id",
|
|
569
550
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
570
551
|
value: input.id
|
|
571
|
-
}, errorFactory)) && (
|
|
552
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
572
553
|
path: _path + ".size",
|
|
573
554
|
expected: "number & Minimum<0>",
|
|
574
555
|
value: input.size
|
|
@@ -578,7 +559,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
578
559
|
value: input.size
|
|
579
560
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
580
561
|
path: _path + ".size",
|
|
581
|
-
expected: "(
|
|
562
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
582
563
|
value: input.size
|
|
583
564
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
584
565
|
path: _path + ".seekable",
|
|
@@ -588,10 +569,6 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
588
569
|
path: _path + ".deleted",
|
|
589
570
|
expected: "boolean",
|
|
590
571
|
value: input.deleted
|
|
591
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
592
|
-
path: _path + ".path",
|
|
593
|
-
expected: "string",
|
|
594
|
-
value: input.path
|
|
595
572
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
596
573
|
path: _path + ".refs",
|
|
597
574
|
expected: "Array<__type>",
|
|
@@ -652,7 +629,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
652
629
|
path: _path + ".hash",
|
|
653
630
|
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
654
631
|
value: input.hash
|
|
655
|
-
}, errorFactory)) && (
|
|
632
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
656
633
|
path: _path + ".btime",
|
|
657
634
|
expected: "number & Minimum<0>",
|
|
658
635
|
value: input.btime
|
|
@@ -662,7 +639,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
662
639
|
value: input.btime
|
|
663
640
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
664
641
|
path: _path + ".btime",
|
|
665
|
-
expected: "(
|
|
642
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
666
643
|
value: input.btime
|
|
667
644
|
}, errorFactory));
|
|
668
645
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -691,25 +668,19 @@ export const randomFileStats = generator => {
|
|
|
691
668
|
const $generator = __typia.createRandom.generator;
|
|
692
669
|
const $pick = __typia.createRandom.pick;
|
|
693
670
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
694
|
-
position: $
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
708
|
-
])(),
|
|
709
|
-
uploading: $pick([
|
|
710
|
-
() => null,
|
|
711
|
-
() => (generator?.boolean ?? $generator.boolean)()
|
|
712
|
-
])(),
|
|
671
|
+
position: (generator?.customs ?? $generator.customs)?.number?.([
|
|
672
|
+
{
|
|
673
|
+
name: "Minimum<0>",
|
|
674
|
+
kind: "minimum",
|
|
675
|
+
value: 0
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "Type<\"uint32\">",
|
|
679
|
+
kind: "type",
|
|
680
|
+
value: "uint32"
|
|
681
|
+
}
|
|
682
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
683
|
+
uploading: (generator?.boolean ?? $generator.boolean)(),
|
|
713
684
|
completed: (generator?.boolean ?? $generator.boolean)(),
|
|
714
685
|
zones: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
715
686
|
replicas: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
@@ -720,24 +691,20 @@ export const randomFileStats = generator => {
|
|
|
720
691
|
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
721
692
|
}
|
|
722
693
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
723
|
-
size: $
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}
|
|
736
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
737
|
-
])(),
|
|
694
|
+
size: (generator?.customs ?? $generator.customs)?.number?.([
|
|
695
|
+
{
|
|
696
|
+
name: "Minimum<0>",
|
|
697
|
+
kind: "minimum",
|
|
698
|
+
value: 0
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
name: "Type<\"uint32\">",
|
|
702
|
+
kind: "type",
|
|
703
|
+
value: "uint32"
|
|
704
|
+
}
|
|
705
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
738
706
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
739
707
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
740
|
-
path: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
741
708
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
742
709
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
743
710
|
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
@@ -750,21 +717,18 @@ export const randomFileStats = generator => {
|
|
|
750
717
|
value: "^([A-Fa-f0-9]{32})?$"
|
|
751
718
|
}
|
|
752
719
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^([A-Fa-f0-9]{32})?$/),
|
|
753
|
-
btime: $
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
767
|
-
])()
|
|
720
|
+
btime: (generator?.customs ?? $generator.customs)?.number?.([
|
|
721
|
+
{
|
|
722
|
+
name: "Minimum<0>",
|
|
723
|
+
kind: "minimum",
|
|
724
|
+
value: 0
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: "Type<\"uint32\">",
|
|
728
|
+
kind: "type",
|
|
729
|
+
value: "uint32"
|
|
730
|
+
}
|
|
731
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
768
732
|
});
|
|
769
733
|
const $ro1 = (_recursive = false, _depth = 0) => ({
|
|
770
734
|
file: $pick([
|
|
@@ -779,7 +743,7 @@ export const randomFileStats = generator => {
|
|
|
779
743
|
};
|
|
780
744
|
export const assertGuardFileStats = (input, errorFactory) => {
|
|
781
745
|
const __is = input => {
|
|
782
|
-
const $io0 = input =>
|
|
746
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
783
747
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
784
748
|
const $io2 = input => "string" === typeof input.message;
|
|
785
749
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -787,7 +751,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
787
751
|
if (false === __is(input))
|
|
788
752
|
((input, _path, _exceptionable = true) => {
|
|
789
753
|
const $guard = __typia.createAssertGuard.guard;
|
|
790
|
-
const $ao0 = (input, _path, _exceptionable = true) => (
|
|
754
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
791
755
|
path: _path + ".position",
|
|
792
756
|
expected: "number & Minimum<0>",
|
|
793
757
|
value: input.position
|
|
@@ -797,11 +761,11 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
797
761
|
value: input.position
|
|
798
762
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
799
763
|
path: _path + ".position",
|
|
800
|
-
expected: "(
|
|
764
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
801
765
|
value: input.position
|
|
802
|
-
}, errorFactory)) && (
|
|
766
|
+
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
803
767
|
path: _path + ".uploading",
|
|
804
|
-
expected: "
|
|
768
|
+
expected: "boolean",
|
|
805
769
|
value: input.uploading
|
|
806
770
|
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
807
771
|
path: _path + ".completed",
|
|
@@ -839,7 +803,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
839
803
|
path: _path + ".id",
|
|
840
804
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
841
805
|
value: input.id
|
|
842
|
-
}, errorFactory)) && (
|
|
806
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
843
807
|
path: _path + ".size",
|
|
844
808
|
expected: "number & Minimum<0>",
|
|
845
809
|
value: input.size
|
|
@@ -849,7 +813,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
849
813
|
value: input.size
|
|
850
814
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
851
815
|
path: _path + ".size",
|
|
852
|
-
expected: "(
|
|
816
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
853
817
|
value: input.size
|
|
854
818
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
855
819
|
path: _path + ".seekable",
|
|
@@ -859,10 +823,6 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
859
823
|
path: _path + ".deleted",
|
|
860
824
|
expected: "boolean",
|
|
861
825
|
value: input.deleted
|
|
862
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
863
|
-
path: _path + ".path",
|
|
864
|
-
expected: "string",
|
|
865
|
-
value: input.path
|
|
866
826
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
867
827
|
path: _path + ".refs",
|
|
868
828
|
expected: "Array<__type>",
|
|
@@ -923,7 +883,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
923
883
|
path: _path + ".hash",
|
|
924
884
|
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
925
885
|
value: input.hash
|
|
926
|
-
}, errorFactory)) && (
|
|
886
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
927
887
|
path: _path + ".btime",
|
|
928
888
|
expected: "number & Minimum<0>",
|
|
929
889
|
value: input.btime
|
|
@@ -933,7 +893,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
933
893
|
value: input.btime
|
|
934
894
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
935
895
|
path: _path + ".btime",
|
|
936
|
-
expected: "(
|
|
896
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
937
897
|
value: input.btime
|
|
938
898
|
}, errorFactory));
|
|
939
899
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -962,13 +922,13 @@ export const stringifyFileStats = input => {
|
|
|
962
922
|
const $io2 = input => "string" === typeof input.message;
|
|
963
923
|
const $string = __typia.json.createStringify.string;
|
|
964
924
|
const $tail = __typia.json.createStringify.tail;
|
|
965
|
-
const $so0 = input => `{"position":${
|
|
925
|
+
const $so0 = input => `{"position":${input.position},"uploading":${input.uploading},"completed":${input.completed},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
966
926
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
967
927
|
return $so0(input);
|
|
968
928
|
};
|
|
969
929
|
export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
970
930
|
const __is = input => {
|
|
971
|
-
const $io0 = input =>
|
|
931
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 4294967295)) && "boolean" === typeof input.uploading && "boolean" === typeof input.completed && (Array.isArray(input.zones) && input.zones.every(elem => "string" === typeof elem)) && (Array.isArray(input.replicas) && input.replicas.every(elem => "string" === typeof elem)) && ("string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id)) && ("number" === typeof input.size && (0 <= input.size && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 4294967295))) && "boolean" === typeof input.seekable && "boolean" === typeof input.deleted && (Array.isArray(input.refs) && input.refs.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && (Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && "string" === typeof input.resumable && "string" === typeof input.mimeType && ("string" === typeof input.hash && /^([A-Fa-f0-9]{32})?$/.test(input.hash)) && ("number" === typeof input.btime && (0 <= input.btime && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 4294967295)));
|
|
972
932
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
973
933
|
const $io2 = input => "string" === typeof input.message;
|
|
974
934
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -976,7 +936,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
976
936
|
if (false === __is(input))
|
|
977
937
|
((input, _path, _exceptionable = true) => {
|
|
978
938
|
const $guard = __typia.json.createAssertStringify.guard;
|
|
979
|
-
const $ao0 = (input, _path, _exceptionable = true) => (
|
|
939
|
+
const $ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.position && (0 <= input.position || $guard(_exceptionable, {
|
|
980
940
|
path: _path + ".position",
|
|
981
941
|
expected: "number & Minimum<0>",
|
|
982
942
|
value: input.position
|
|
@@ -986,11 +946,11 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
986
946
|
value: input.position
|
|
987
947
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
988
948
|
path: _path + ".position",
|
|
989
|
-
expected: "(
|
|
949
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
990
950
|
value: input.position
|
|
991
|
-
}, errorFactory)) && (
|
|
951
|
+
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
992
952
|
path: _path + ".uploading",
|
|
993
|
-
expected: "
|
|
953
|
+
expected: "boolean",
|
|
994
954
|
value: input.uploading
|
|
995
955
|
}, errorFactory)) && ("boolean" === typeof input.completed || $guard(_exceptionable, {
|
|
996
956
|
path: _path + ".completed",
|
|
@@ -1028,7 +988,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1028
988
|
path: _path + ".id",
|
|
1029
989
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1030
990
|
value: input.id
|
|
1031
|
-
}, errorFactory)) && (
|
|
991
|
+
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
1032
992
|
path: _path + ".size",
|
|
1033
993
|
expected: "number & Minimum<0>",
|
|
1034
994
|
value: input.size
|
|
@@ -1038,7 +998,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1038
998
|
value: input.size
|
|
1039
999
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1040
1000
|
path: _path + ".size",
|
|
1041
|
-
expected: "(
|
|
1001
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
1042
1002
|
value: input.size
|
|
1043
1003
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
1044
1004
|
path: _path + ".seekable",
|
|
@@ -1048,10 +1008,6 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1048
1008
|
path: _path + ".deleted",
|
|
1049
1009
|
expected: "boolean",
|
|
1050
1010
|
value: input.deleted
|
|
1051
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
1052
|
-
path: _path + ".path",
|
|
1053
|
-
expected: "string",
|
|
1054
|
-
value: input.path
|
|
1055
1011
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
1056
1012
|
path: _path + ".refs",
|
|
1057
1013
|
expected: "Array<__type>",
|
|
@@ -1112,7 +1068,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1112
1068
|
path: _path + ".hash",
|
|
1113
1069
|
expected: "(string & Pattern<\"^([A-Fa-f0-9]{32})?$\">)",
|
|
1114
1070
|
value: input.hash
|
|
1115
|
-
}, errorFactory)) && (
|
|
1071
|
+
}, errorFactory)) && ("number" === typeof input.btime && (0 <= input.btime || $guard(_exceptionable, {
|
|
1116
1072
|
path: _path + ".btime",
|
|
1117
1073
|
expected: "number & Minimum<0>",
|
|
1118
1074
|
value: input.btime
|
|
@@ -1122,7 +1078,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1122
1078
|
value: input.btime
|
|
1123
1079
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1124
1080
|
path: _path + ".btime",
|
|
1125
|
-
expected: "(
|
|
1081
|
+
expected: "(number & Minimum<0> & Type<\"uint32\">)",
|
|
1126
1082
|
value: input.btime
|
|
1127
1083
|
}, errorFactory));
|
|
1128
1084
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -1151,7 +1107,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1151
1107
|
const $io2 = input => "string" === typeof input.message;
|
|
1152
1108
|
const $string = __typia.json.createAssertStringify.string;
|
|
1153
1109
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
1154
|
-
const $so0 = input => `{"position":${
|
|
1110
|
+
const $so0 = input => `{"position":${input.position},"uploading":${input.uploading},"completed":${input.completed},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"error":${`[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime}}`;
|
|
1155
1111
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
1156
1112
|
return $so0(input);
|
|
1157
1113
|
}; return stringify(assert(input, errorFactory)); };
|