@nxtedition/types 1.2.5 → 1.2.7
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 +4 -4
- package/dist/common/block.js +122 -122
- package/dist/common/file.d.ts +3 -3
- package/dist/common/file.js +63 -63
- package/dist/common/location.d.ts +0 -2
- package/dist/common/location.js +6 -35
- package/package.json +1 -1
package/dist/common/file.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type AssertionGuard as __AssertionGuard } from "typia";
|
|
|
2
2
|
import { tags } from 'typia';
|
|
3
3
|
export interface File {
|
|
4
4
|
id: string & tags.Pattern<"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$">;
|
|
5
|
-
size: number & tags.Minimum<0> & tags.Type<"
|
|
5
|
+
size: number & tags.Minimum<0> & tags.Type<"uint64">;
|
|
6
6
|
seekable: boolean;
|
|
7
7
|
deleted: boolean;
|
|
8
8
|
refs: Array<{
|
|
@@ -15,7 +15,7 @@ export interface File {
|
|
|
15
15
|
resumable: string;
|
|
16
16
|
mimeType: string;
|
|
17
17
|
hash: string & tags.Pattern<"^([A-Fa-f0-9]{32})?$">;
|
|
18
|
-
btime: number & tags.Minimum<0> & tags.Type<"
|
|
18
|
+
btime: number & tags.Minimum<0> & tags.Type<"uint64">;
|
|
19
19
|
}
|
|
20
20
|
export declare const isFile: (input: unknown) => input is File;
|
|
21
21
|
export declare const assertFile: (input: unknown) => File;
|
|
@@ -24,7 +24,7 @@ export declare const assertGuardFile: __AssertionGuard<File>;
|
|
|
24
24
|
export declare const stringifyFile: (input: File) => string;
|
|
25
25
|
export declare const assertStringifyFile: (input: unknown) => string;
|
|
26
26
|
export interface FileStats extends File {
|
|
27
|
-
position: number & tags.Minimum<0> & tags.Type<"
|
|
27
|
+
position: number & tags.Minimum<0> & tags.Type<"uint64">;
|
|
28
28
|
uploading: boolean;
|
|
29
29
|
completed: boolean;
|
|
30
30
|
zones: string[];
|
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 <=
|
|
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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
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 <=
|
|
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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
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);
|
|
@@ -27,13 +27,13 @@ export const assertFile = (input, errorFactory) => {
|
|
|
27
27
|
path: _path + ".size",
|
|
28
28
|
expected: "number & Minimum<0>",
|
|
29
29
|
value: input.size
|
|
30
|
-
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <=
|
|
30
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
|
|
31
31
|
path: _path + ".size",
|
|
32
|
-
expected: "number & Type<\"
|
|
32
|
+
expected: "number & Type<\"uint64\">",
|
|
33
33
|
value: input.size
|
|
34
34
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
35
35
|
path: _path + ".size",
|
|
36
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
36
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
37
37
|
value: input.size
|
|
38
38
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
39
39
|
path: _path + ".seekable",
|
|
@@ -107,13 +107,13 @@ export const assertFile = (input, errorFactory) => {
|
|
|
107
107
|
path: _path + ".btime",
|
|
108
108
|
expected: "number & Minimum<0>",
|
|
109
109
|
value: input.btime
|
|
110
|
-
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <=
|
|
110
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
|
|
111
111
|
path: _path + ".btime",
|
|
112
|
-
expected: "number & Type<\"
|
|
112
|
+
expected: "number & Type<\"uint64\">",
|
|
113
113
|
value: input.btime
|
|
114
114
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
115
115
|
path: _path + ".btime",
|
|
116
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
116
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
117
117
|
value: input.btime
|
|
118
118
|
}, errorFactory));
|
|
119
119
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -156,9 +156,9 @@ export const randomFile = generator => {
|
|
|
156
156
|
value: 0
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
|
-
name: "Type<\"
|
|
159
|
+
name: "Type<\"uint64\">",
|
|
160
160
|
kind: "type",
|
|
161
|
-
value: "
|
|
161
|
+
value: "uint64"
|
|
162
162
|
}
|
|
163
163
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
164
164
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
@@ -185,9 +185,9 @@ export const randomFile = generator => {
|
|
|
185
185
|
value: 0
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
|
-
name: "Type<\"
|
|
188
|
+
name: "Type<\"uint64\">",
|
|
189
189
|
kind: "type",
|
|
190
|
-
value: "
|
|
190
|
+
value: "uint64"
|
|
191
191
|
}
|
|
192
192
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
193
193
|
});
|
|
@@ -204,7 +204,7 @@ export const randomFile = generator => {
|
|
|
204
204
|
};
|
|
205
205
|
export const assertGuardFile = (input, errorFactory) => {
|
|
206
206
|
const __is = input => {
|
|
207
|
-
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 <=
|
|
207
|
+
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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
208
208
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
209
209
|
const $io2 = input => "string" === typeof input.message;
|
|
210
210
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -224,13 +224,13 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
224
224
|
path: _path + ".size",
|
|
225
225
|
expected: "number & Minimum<0>",
|
|
226
226
|
value: input.size
|
|
227
|
-
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <=
|
|
227
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
|
|
228
228
|
path: _path + ".size",
|
|
229
|
-
expected: "number & Type<\"
|
|
229
|
+
expected: "number & Type<\"uint64\">",
|
|
230
230
|
value: input.size
|
|
231
231
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
232
232
|
path: _path + ".size",
|
|
233
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
233
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
234
234
|
value: input.size
|
|
235
235
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
236
236
|
path: _path + ".seekable",
|
|
@@ -304,13 +304,13 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
304
304
|
path: _path + ".btime",
|
|
305
305
|
expected: "number & Minimum<0>",
|
|
306
306
|
value: input.btime
|
|
307
|
-
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <=
|
|
307
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
|
|
308
308
|
path: _path + ".btime",
|
|
309
|
-
expected: "number & Type<\"
|
|
309
|
+
expected: "number & Type<\"uint64\">",
|
|
310
310
|
value: input.btime
|
|
311
311
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
312
312
|
path: _path + ".btime",
|
|
313
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
313
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
314
314
|
value: input.btime
|
|
315
315
|
}, errorFactory));
|
|
316
316
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -345,7 +345,7 @@ export const stringifyFile = input => {
|
|
|
345
345
|
};
|
|
346
346
|
export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
347
347
|
const __is = input => {
|
|
348
|
-
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 <=
|
|
348
|
+
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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
349
349
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
350
350
|
const $io2 = input => "string" === typeof input.message;
|
|
351
351
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -365,13 +365,13 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
365
365
|
path: _path + ".size",
|
|
366
366
|
expected: "number & Minimum<0>",
|
|
367
367
|
value: input.size
|
|
368
|
-
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <=
|
|
368
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
|
|
369
369
|
path: _path + ".size",
|
|
370
|
-
expected: "number & Type<\"
|
|
370
|
+
expected: "number & Type<\"uint64\">",
|
|
371
371
|
value: input.size
|
|
372
372
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
373
373
|
path: _path + ".size",
|
|
374
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
374
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
375
375
|
value: input.size
|
|
376
376
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
377
377
|
path: _path + ".seekable",
|
|
@@ -445,13 +445,13 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
445
445
|
path: _path + ".btime",
|
|
446
446
|
expected: "number & Minimum<0>",
|
|
447
447
|
value: input.btime
|
|
448
|
-
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <=
|
|
448
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
|
|
449
449
|
path: _path + ".btime",
|
|
450
|
-
expected: "number & Type<\"
|
|
450
|
+
expected: "number & Type<\"uint64\">",
|
|
451
451
|
value: input.btime
|
|
452
452
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
453
453
|
path: _path + ".btime",
|
|
454
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
454
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
455
455
|
value: input.btime
|
|
456
456
|
}, errorFactory));
|
|
457
457
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -485,14 +485,14 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
485
485
|
return $so0(input);
|
|
486
486
|
}; return stringify(assert(input, errorFactory)); };
|
|
487
487
|
export const isFileStats = input => {
|
|
488
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
488
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
489
489
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
490
490
|
const $io2 = input => "string" === typeof input.message;
|
|
491
491
|
return "object" === typeof input && null !== input && $io0(input);
|
|
492
492
|
};
|
|
493
493
|
export const assertFileStats = (input, errorFactory) => {
|
|
494
494
|
const __is = input => {
|
|
495
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
495
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
496
496
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
497
497
|
const $io2 = input => "string" === typeof input.message;
|
|
498
498
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -504,13 +504,13 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
504
504
|
path: _path + ".position",
|
|
505
505
|
expected: "number & Minimum<0>",
|
|
506
506
|
value: input.position
|
|
507
|
-
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
507
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
|
|
508
508
|
path: _path + ".position",
|
|
509
|
-
expected: "number & Type<\"
|
|
509
|
+
expected: "number & Type<\"uint64\">",
|
|
510
510
|
value: input.position
|
|
511
511
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
512
512
|
path: _path + ".position",
|
|
513
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
513
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
514
514
|
value: input.position
|
|
515
515
|
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
516
516
|
path: _path + ".uploading",
|
|
@@ -556,13 +556,13 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
556
556
|
path: _path + ".size",
|
|
557
557
|
expected: "number & Minimum<0>",
|
|
558
558
|
value: input.size
|
|
559
|
-
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <=
|
|
559
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
|
|
560
560
|
path: _path + ".size",
|
|
561
|
-
expected: "number & Type<\"
|
|
561
|
+
expected: "number & Type<\"uint64\">",
|
|
562
562
|
value: input.size
|
|
563
563
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
564
564
|
path: _path + ".size",
|
|
565
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
565
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
566
566
|
value: input.size
|
|
567
567
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
568
568
|
path: _path + ".seekable",
|
|
@@ -636,13 +636,13 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
636
636
|
path: _path + ".btime",
|
|
637
637
|
expected: "number & Minimum<0>",
|
|
638
638
|
value: input.btime
|
|
639
|
-
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <=
|
|
639
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
|
|
640
640
|
path: _path + ".btime",
|
|
641
|
-
expected: "number & Type<\"
|
|
641
|
+
expected: "number & Type<\"uint64\">",
|
|
642
642
|
value: input.btime
|
|
643
643
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
644
644
|
path: _path + ".btime",
|
|
645
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
645
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
646
646
|
value: input.btime
|
|
647
647
|
}, errorFactory));
|
|
648
648
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -678,9 +678,9 @@ export const randomFileStats = generator => {
|
|
|
678
678
|
value: 0
|
|
679
679
|
},
|
|
680
680
|
{
|
|
681
|
-
name: "Type<\"
|
|
681
|
+
name: "Type<\"uint64\">",
|
|
682
682
|
kind: "type",
|
|
683
|
-
value: "
|
|
683
|
+
value: "uint64"
|
|
684
684
|
}
|
|
685
685
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
686
686
|
uploading: (generator?.boolean ?? $generator.boolean)(),
|
|
@@ -701,9 +701,9 @@ export const randomFileStats = generator => {
|
|
|
701
701
|
value: 0
|
|
702
702
|
},
|
|
703
703
|
{
|
|
704
|
-
name: "Type<\"
|
|
704
|
+
name: "Type<\"uint64\">",
|
|
705
705
|
kind: "type",
|
|
706
|
-
value: "
|
|
706
|
+
value: "uint64"
|
|
707
707
|
}
|
|
708
708
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10),
|
|
709
709
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
@@ -730,9 +730,9 @@ export const randomFileStats = generator => {
|
|
|
730
730
|
value: 0
|
|
731
731
|
},
|
|
732
732
|
{
|
|
733
|
-
name: "Type<\"
|
|
733
|
+
name: "Type<\"uint64\">",
|
|
734
734
|
kind: "type",
|
|
735
|
-
value: "
|
|
735
|
+
value: "uint64"
|
|
736
736
|
}
|
|
737
737
|
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
738
738
|
});
|
|
@@ -749,7 +749,7 @@ export const randomFileStats = generator => {
|
|
|
749
749
|
};
|
|
750
750
|
export const assertGuardFileStats = (input, errorFactory) => {
|
|
751
751
|
const __is = input => {
|
|
752
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
752
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
753
753
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
754
754
|
const $io2 = input => "string" === typeof input.message;
|
|
755
755
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -761,13 +761,13 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
761
761
|
path: _path + ".position",
|
|
762
762
|
expected: "number & Minimum<0>",
|
|
763
763
|
value: input.position
|
|
764
|
-
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
764
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
|
|
765
765
|
path: _path + ".position",
|
|
766
|
-
expected: "number & Type<\"
|
|
766
|
+
expected: "number & Type<\"uint64\">",
|
|
767
767
|
value: input.position
|
|
768
768
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
769
769
|
path: _path + ".position",
|
|
770
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
770
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
771
771
|
value: input.position
|
|
772
772
|
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
773
773
|
path: _path + ".uploading",
|
|
@@ -813,13 +813,13 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
813
813
|
path: _path + ".size",
|
|
814
814
|
expected: "number & Minimum<0>",
|
|
815
815
|
value: input.size
|
|
816
|
-
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <=
|
|
816
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
|
|
817
817
|
path: _path + ".size",
|
|
818
|
-
expected: "number & Type<\"
|
|
818
|
+
expected: "number & Type<\"uint64\">",
|
|
819
819
|
value: input.size
|
|
820
820
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
821
821
|
path: _path + ".size",
|
|
822
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
822
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
823
823
|
value: input.size
|
|
824
824
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
825
825
|
path: _path + ".seekable",
|
|
@@ -893,13 +893,13 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
893
893
|
path: _path + ".btime",
|
|
894
894
|
expected: "number & Minimum<0>",
|
|
895
895
|
value: input.btime
|
|
896
|
-
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <=
|
|
896
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
|
|
897
897
|
path: _path + ".btime",
|
|
898
|
-
expected: "number & Type<\"
|
|
898
|
+
expected: "number & Type<\"uint64\">",
|
|
899
899
|
value: input.btime
|
|
900
900
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
901
901
|
path: _path + ".btime",
|
|
902
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
902
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
903
903
|
value: input.btime
|
|
904
904
|
}, errorFactory));
|
|
905
905
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -934,7 +934,7 @@ export const stringifyFileStats = input => {
|
|
|
934
934
|
};
|
|
935
935
|
export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
936
936
|
const __is = input => {
|
|
937
|
-
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
937
|
+
const $io0 = input => "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000)) && "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 <= 18446744073709552000))) && "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)) && (null === input.error || 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 <= 18446744073709552000)));
|
|
938
938
|
const $io1 = input => undefined === input.file || "string" === typeof input.file;
|
|
939
939
|
const $io2 = input => "string" === typeof input.message;
|
|
940
940
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -946,13 +946,13 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
946
946
|
path: _path + ".position",
|
|
947
947
|
expected: "number & Minimum<0>",
|
|
948
948
|
value: input.position
|
|
949
|
-
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <=
|
|
949
|
+
}, errorFactory)) && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000 || $guard(_exceptionable, {
|
|
950
950
|
path: _path + ".position",
|
|
951
|
-
expected: "number & Type<\"
|
|
951
|
+
expected: "number & Type<\"uint64\">",
|
|
952
952
|
value: input.position
|
|
953
953
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
954
954
|
path: _path + ".position",
|
|
955
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
955
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
956
956
|
value: input.position
|
|
957
957
|
}, errorFactory)) && ("boolean" === typeof input.uploading || $guard(_exceptionable, {
|
|
958
958
|
path: _path + ".uploading",
|
|
@@ -998,13 +998,13 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
998
998
|
path: _path + ".size",
|
|
999
999
|
expected: "number & Minimum<0>",
|
|
1000
1000
|
value: input.size
|
|
1001
|
-
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <=
|
|
1001
|
+
}, errorFactory)) && (Math.floor(input.size) === input.size && 0 <= input.size && input.size <= 18446744073709552000 || $guard(_exceptionable, {
|
|
1002
1002
|
path: _path + ".size",
|
|
1003
|
-
expected: "number & Type<\"
|
|
1003
|
+
expected: "number & Type<\"uint64\">",
|
|
1004
1004
|
value: input.size
|
|
1005
1005
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1006
1006
|
path: _path + ".size",
|
|
1007
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
1007
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
1008
1008
|
value: input.size
|
|
1009
1009
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
1010
1010
|
path: _path + ".seekable",
|
|
@@ -1078,13 +1078,13 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1078
1078
|
path: _path + ".btime",
|
|
1079
1079
|
expected: "number & Minimum<0>",
|
|
1080
1080
|
value: input.btime
|
|
1081
|
-
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <=
|
|
1081
|
+
}, errorFactory)) && (Math.floor(input.btime) === input.btime && 0 <= input.btime && input.btime <= 18446744073709552000 || $guard(_exceptionable, {
|
|
1082
1082
|
path: _path + ".btime",
|
|
1083
|
-
expected: "number & Type<\"
|
|
1083
|
+
expected: "number & Type<\"uint64\">",
|
|
1084
1084
|
value: input.btime
|
|
1085
1085
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1086
1086
|
path: _path + ".btime",
|
|
1087
|
-
expected: "(number & Minimum<0> & Type<\"
|
|
1087
|
+
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
1088
1088
|
value: input.btime
|
|
1089
1089
|
}, errorFactory));
|
|
1090
1090
|
const $ao1 = (input, _path, _exceptionable = true) => undefined === input.file || "string" === typeof input.file || $guard(_exceptionable, {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { type AssertionGuard as __AssertionGuard } from "typia";
|
|
2
2
|
export interface Location {
|
|
3
3
|
id: string;
|
|
4
|
-
title: string | null;
|
|
5
4
|
size: number | null;
|
|
6
5
|
free: number | null;
|
|
7
6
|
capcity: number | null;
|
|
8
7
|
available: number | null;
|
|
9
8
|
cache: boolean | null;
|
|
10
|
-
limit: number;
|
|
11
9
|
origin: string;
|
|
12
10
|
zone: string;
|
|
13
11
|
allows: string[];
|
package/dist/common/location.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import __typia from "typia";
|
|
2
2
|
export const isLocation = input => {
|
|
3
|
-
const $io0 = input => "string" === typeof input.id && (null === input.
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && (null === input.size || "number" === typeof input.size) && (null === input.free || "number" === typeof input.free) && (null === input.capcity || "number" === typeof input.capcity) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
|
|
4
4
|
return "object" === typeof input && null !== input && $io0(input);
|
|
5
5
|
};
|
|
6
6
|
export const assertLocation = (input, errorFactory) => {
|
|
7
7
|
const __is = input => {
|
|
8
|
-
const $io0 = input => "string" === typeof input.id && (null === input.
|
|
8
|
+
const $io0 = input => "string" === typeof input.id && (null === input.size || "number" === typeof input.size) && (null === input.free || "number" === typeof input.free) && (null === input.capcity || "number" === typeof input.capcity) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
|
|
9
9
|
return "object" === typeof input && null !== input && $io0(input);
|
|
10
10
|
};
|
|
11
11
|
if (false === __is(input))
|
|
@@ -15,10 +15,6 @@ export const assertLocation = (input, errorFactory) => {
|
|
|
15
15
|
path: _path + ".id",
|
|
16
16
|
expected: "string",
|
|
17
17
|
value: input.id
|
|
18
|
-
}, errorFactory)) && (null === input.title || "string" === typeof input.title || $guard(_exceptionable, {
|
|
19
|
-
path: _path + ".title",
|
|
20
|
-
expected: "(null | string)",
|
|
21
|
-
value: input.title
|
|
22
18
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size || $guard(_exceptionable, {
|
|
23
19
|
path: _path + ".size",
|
|
24
20
|
expected: "(null | number)",
|
|
@@ -39,10 +35,6 @@ export const assertLocation = (input, errorFactory) => {
|
|
|
39
35
|
path: _path + ".cache",
|
|
40
36
|
expected: "(boolean | null)",
|
|
41
37
|
value: input.cache
|
|
42
|
-
}, errorFactory)) && ("number" === typeof input.limit || $guard(_exceptionable, {
|
|
43
|
-
path: _path + ".limit",
|
|
44
|
-
expected: "number",
|
|
45
|
-
value: input.limit
|
|
46
38
|
}, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
|
|
47
39
|
path: _path + ".origin",
|
|
48
40
|
expected: "string",
|
|
@@ -81,10 +73,6 @@ export const randomLocation = generator => {
|
|
|
81
73
|
const $pick = __typia.createRandom.pick;
|
|
82
74
|
const $ro0 = (_recursive = false, _depth = 0) => ({
|
|
83
75
|
id: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
84
|
-
title: $pick([
|
|
85
|
-
() => null,
|
|
86
|
-
() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()
|
|
87
|
-
])(),
|
|
88
76
|
size: $pick([
|
|
89
77
|
() => null,
|
|
90
78
|
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
@@ -105,7 +93,6 @@ export const randomLocation = generator => {
|
|
|
105
93
|
() => null,
|
|
106
94
|
() => (generator?.boolean ?? $generator.boolean)()
|
|
107
95
|
])(),
|
|
108
|
-
limit: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
|
|
109
96
|
origin: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
110
97
|
zone: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
|
|
111
98
|
allows: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
|
|
@@ -114,7 +101,7 @@ export const randomLocation = generator => {
|
|
|
114
101
|
};
|
|
115
102
|
export const assertGuardLocation = (input, errorFactory) => {
|
|
116
103
|
const __is = input => {
|
|
117
|
-
const $io0 = input => "string" === typeof input.id && (null === input.
|
|
104
|
+
const $io0 = input => "string" === typeof input.id && (null === input.size || "number" === typeof input.size) && (null === input.free || "number" === typeof input.free) && (null === input.capcity || "number" === typeof input.capcity) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
|
|
118
105
|
return "object" === typeof input && null !== input && $io0(input);
|
|
119
106
|
};
|
|
120
107
|
if (false === __is(input))
|
|
@@ -124,10 +111,6 @@ export const assertGuardLocation = (input, errorFactory) => {
|
|
|
124
111
|
path: _path + ".id",
|
|
125
112
|
expected: "string",
|
|
126
113
|
value: input.id
|
|
127
|
-
}, errorFactory)) && (null === input.title || "string" === typeof input.title || $guard(_exceptionable, {
|
|
128
|
-
path: _path + ".title",
|
|
129
|
-
expected: "(null | string)",
|
|
130
|
-
value: input.title
|
|
131
114
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size || $guard(_exceptionable, {
|
|
132
115
|
path: _path + ".size",
|
|
133
116
|
expected: "(null | number)",
|
|
@@ -148,10 +131,6 @@ export const assertGuardLocation = (input, errorFactory) => {
|
|
|
148
131
|
path: _path + ".cache",
|
|
149
132
|
expected: "(boolean | null)",
|
|
150
133
|
value: input.cache
|
|
151
|
-
}, errorFactory)) && ("number" === typeof input.limit || $guard(_exceptionable, {
|
|
152
|
-
path: _path + ".limit",
|
|
153
|
-
expected: "number",
|
|
154
|
-
value: input.limit
|
|
155
134
|
}, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
|
|
156
135
|
path: _path + ".origin",
|
|
157
136
|
expected: "string",
|
|
@@ -186,12 +165,12 @@ export const assertGuardLocation = (input, errorFactory) => {
|
|
|
186
165
|
};
|
|
187
166
|
export const stringifyLocation = input => {
|
|
188
167
|
const $string = __typia.json.createStringify.string;
|
|
189
|
-
const $so0 = input => `{"id":${$string(input.id)},"
|
|
168
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"free":${null !== input.free ? input.free : "null"},"capcity":${null !== input.capcity ? input.capcity : "null"},"available":${null !== input.available ? input.available : "null"},"cache":${null !== input.cache ? input.cache : "null"},"origin":${$string(input.origin)},"zone":${$string(input.zone)},"allows":${`[${input.allows.map(elem => $string(elem)).join(",")}]`}}`;
|
|
190
169
|
return $so0(input);
|
|
191
170
|
};
|
|
192
171
|
export const assertStringifyLocation = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
193
172
|
const __is = input => {
|
|
194
|
-
const $io0 = input => "string" === typeof input.id && (null === input.
|
|
173
|
+
const $io0 = input => "string" === typeof input.id && (null === input.size || "number" === typeof input.size && !Number.isNaN(input.size)) && (null === input.free || "number" === typeof input.free && !Number.isNaN(input.free)) && (null === input.capcity || "number" === typeof input.capcity && !Number.isNaN(input.capcity)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available)) && (null === input.cache || "boolean" === typeof input.cache) && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
|
|
195
174
|
return "object" === typeof input && null !== input && $io0(input);
|
|
196
175
|
};
|
|
197
176
|
if (false === __is(input))
|
|
@@ -201,10 +180,6 @@ export const assertStringifyLocation = (input, errorFactory) => { const assert =
|
|
|
201
180
|
path: _path + ".id",
|
|
202
181
|
expected: "string",
|
|
203
182
|
value: input.id
|
|
204
|
-
}, errorFactory)) && (null === input.title || "string" === typeof input.title || $guard(_exceptionable, {
|
|
205
|
-
path: _path + ".title",
|
|
206
|
-
expected: "(null | string)",
|
|
207
|
-
value: input.title
|
|
208
183
|
}, errorFactory)) && (null === input.size || "number" === typeof input.size && !Number.isNaN(input.size) || $guard(_exceptionable, {
|
|
209
184
|
path: _path + ".size",
|
|
210
185
|
expected: "(null | number)",
|
|
@@ -225,10 +200,6 @@ export const assertStringifyLocation = (input, errorFactory) => { const assert =
|
|
|
225
200
|
path: _path + ".cache",
|
|
226
201
|
expected: "(boolean | null)",
|
|
227
202
|
value: input.cache
|
|
228
|
-
}, errorFactory)) && ("number" === typeof input.limit && !Number.isNaN(input.limit) || $guard(_exceptionable, {
|
|
229
|
-
path: _path + ".limit",
|
|
230
|
-
expected: "number",
|
|
231
|
-
value: input.limit
|
|
232
203
|
}, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
|
|
233
204
|
path: _path + ".origin",
|
|
234
205
|
expected: "string",
|
|
@@ -263,6 +234,6 @@ export const assertStringifyLocation = (input, errorFactory) => { const assert =
|
|
|
263
234
|
return input;
|
|
264
235
|
}; const stringify = input => {
|
|
265
236
|
const $string = __typia.json.createAssertStringify.string;
|
|
266
|
-
const $so0 = input => `{"id":${$string(input.id)},"
|
|
237
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"free":${null !== input.free ? input.free : "null"},"capcity":${null !== input.capcity ? input.capcity : "null"},"available":${null !== input.available ? input.available : "null"},"cache":${null !== input.cache ? input.cache : "null"},"origin":${$string(input.origin)},"zone":${$string(input.zone)},"allows":${`[${input.allows.map(elem => $string(elem)).join(",")}]`}}`;
|
|
267
238
|
return $so0(input);
|
|
268
239
|
}; return stringify(assert(input, errorFactory)); };
|