@nxtedition/types 1.2.2 → 1.2.4
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/file.d.ts +0 -1
- package/dist/common/file.js +12 -38
- package/package.json +1 -1
package/dist/common/file.d.ts
CHANGED
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) && ("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 &&
|
|
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) && ("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 &&
|
|
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);
|
|
@@ -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>",
|
|
@@ -167,7 +163,6 @@ export const randomFile = generator => {
|
|
|
167
163
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
168
164
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
169
165
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
170
|
-
path: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
171
166
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
172
167
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
173
168
|
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
@@ -206,7 +201,7 @@ export const randomFile = generator => {
|
|
|
206
201
|
};
|
|
207
202
|
export const assertGuardFile = (input, errorFactory) => {
|
|
208
203
|
const __is = input => {
|
|
209
|
-
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 &&
|
|
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)));
|
|
210
205
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
211
206
|
const $io2 = input => "string" === typeof input.message;
|
|
212
207
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -242,10 +237,6 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
242
237
|
path: _path + ".deleted",
|
|
243
238
|
expected: "boolean",
|
|
244
239
|
value: input.deleted
|
|
245
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
246
|
-
path: _path + ".path",
|
|
247
|
-
expected: "string",
|
|
248
|
-
value: input.path
|
|
249
240
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
250
241
|
path: _path + ".refs",
|
|
251
242
|
expected: "Array<__type>",
|
|
@@ -345,13 +336,13 @@ export const stringifyFile = input => {
|
|
|
345
336
|
const $io2 = input => "string" === typeof input.message;
|
|
346
337
|
const $string = __typia.json.createStringify.string;
|
|
347
338
|
const $tail = __typia.json.createStringify.tail;
|
|
348
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"
|
|
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}}`;
|
|
349
340
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
350
341
|
return $so0(input);
|
|
351
342
|
};
|
|
352
343
|
export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
353
344
|
const __is = input => {
|
|
354
|
-
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 &&
|
|
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)));
|
|
355
346
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
356
347
|
const $io2 = input => "string" === typeof input.message;
|
|
357
348
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -387,10 +378,6 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
387
378
|
path: _path + ".deleted",
|
|
388
379
|
expected: "boolean",
|
|
389
380
|
value: input.deleted
|
|
390
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
391
|
-
path: _path + ".path",
|
|
392
|
-
expected: "string",
|
|
393
|
-
value: input.path
|
|
394
381
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
395
382
|
path: _path + ".refs",
|
|
396
383
|
expected: "Array<__type>",
|
|
@@ -490,19 +477,19 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
490
477
|
const $io2 = input => "string" === typeof input.message;
|
|
491
478
|
const $string = __typia.json.createAssertStringify.string;
|
|
492
479
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
493
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${input.size},"seekable":${input.seekable},"deleted":${input.deleted},"
|
|
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}}`;
|
|
494
481
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
495
482
|
return $so0(input);
|
|
496
483
|
}; return stringify(assert(input, errorFactory)); };
|
|
497
484
|
export const isFileStats = input => {
|
|
498
|
-
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 &&
|
|
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)));
|
|
499
486
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
500
487
|
const $io2 = input => "string" === typeof input.message;
|
|
501
488
|
return "object" === typeof input && null !== input && $io0(input);
|
|
502
489
|
};
|
|
503
490
|
export const assertFileStats = (input, errorFactory) => {
|
|
504
491
|
const __is = input => {
|
|
505
|
-
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 &&
|
|
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)));
|
|
506
493
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
507
494
|
const $io2 = input => "string" === typeof input.message;
|
|
508
495
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -582,10 +569,6 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
582
569
|
path: _path + ".deleted",
|
|
583
570
|
expected: "boolean",
|
|
584
571
|
value: input.deleted
|
|
585
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
586
|
-
path: _path + ".path",
|
|
587
|
-
expected: "string",
|
|
588
|
-
value: input.path
|
|
589
572
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
590
573
|
path: _path + ".refs",
|
|
591
574
|
expected: "Array<__type>",
|
|
@@ -722,7 +705,6 @@ export const randomFileStats = generator => {
|
|
|
722
705
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
723
706
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
724
707
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
725
|
-
path: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
726
708
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
727
709
|
tags: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()),
|
|
728
710
|
error: (generator?.array ?? $generator.array)(() => $ro2(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
@@ -761,7 +743,7 @@ export const randomFileStats = generator => {
|
|
|
761
743
|
};
|
|
762
744
|
export const assertGuardFileStats = (input, errorFactory) => {
|
|
763
745
|
const __is = input => {
|
|
764
|
-
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 &&
|
|
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)));
|
|
765
747
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
766
748
|
const $io2 = input => "string" === typeof input.message;
|
|
767
749
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -841,10 +823,6 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
841
823
|
path: _path + ".deleted",
|
|
842
824
|
expected: "boolean",
|
|
843
825
|
value: input.deleted
|
|
844
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
845
|
-
path: _path + ".path",
|
|
846
|
-
expected: "string",
|
|
847
|
-
value: input.path
|
|
848
826
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
849
827
|
path: _path + ".refs",
|
|
850
828
|
expected: "Array<__type>",
|
|
@@ -944,13 +922,13 @@ export const stringifyFileStats = input => {
|
|
|
944
922
|
const $io2 = input => "string" === typeof input.message;
|
|
945
923
|
const $string = __typia.json.createStringify.string;
|
|
946
924
|
const $tail = __typia.json.createStringify.tail;
|
|
947
|
-
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},"
|
|
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}}`;
|
|
948
926
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
949
927
|
return $so0(input);
|
|
950
928
|
};
|
|
951
929
|
export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
952
930
|
const __is = input => {
|
|
953
|
-
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 &&
|
|
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)));
|
|
954
932
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
955
933
|
const $io2 = input => "string" === typeof input.message;
|
|
956
934
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -1030,10 +1008,6 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1030
1008
|
path: _path + ".deleted",
|
|
1031
1009
|
expected: "boolean",
|
|
1032
1010
|
value: input.deleted
|
|
1033
|
-
}, errorFactory)) && ("string" === typeof input.path || $guard(_exceptionable, {
|
|
1034
|
-
path: _path + ".path",
|
|
1035
|
-
expected: "string",
|
|
1036
|
-
value: input.path
|
|
1037
1011
|
}, errorFactory)) && ((Array.isArray(input.refs) || $guard(_exceptionable, {
|
|
1038
1012
|
path: _path + ".refs",
|
|
1039
1013
|
expected: "Array<__type>",
|
|
@@ -1133,7 +1107,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1133
1107
|
const $io2 = input => "string" === typeof input.message;
|
|
1134
1108
|
const $string = __typia.json.createAssertStringify.string;
|
|
1135
1109
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
1136
|
-
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},"
|
|
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}}`;
|
|
1137
1111
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined}`}`)}}`;
|
|
1138
1112
|
return $so0(input);
|
|
1139
1113
|
}; return stringify(assert(input, errorFactory)); };
|