@nxtedition/types 1.6.2 → 1.6.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/file.d.ts +1 -1
- package/dist/common/file.js +54 -48
- 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<"uint64"
|
|
5
|
+
size: (number & tags.Minimum<0> & tags.Type<"uint64">) | null;
|
|
6
6
|
seekable: boolean;
|
|
7
7
|
deleted: boolean;
|
|
8
8
|
refs: Array<{
|
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 <= 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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
3
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
4
4
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
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 <= 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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
10
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
11
11
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
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)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
26
|
+
}, errorFactory)) && (null === input.size || "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: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
36
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
37
37
|
value: input.size
|
|
38
38
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
39
39
|
path: _path + ".seekable",
|
|
@@ -165,18 +165,21 @@ export const randomFile = generator => {
|
|
|
165
165
|
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
166
166
|
}
|
|
167
167
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
168
|
-
size:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
size: $pick([
|
|
169
|
+
() => null,
|
|
170
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
171
|
+
{
|
|
172
|
+
name: "Minimum<0>",
|
|
173
|
+
kind: "minimum",
|
|
174
|
+
value: 0
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "Type<\"uint64\">",
|
|
178
|
+
kind: "type",
|
|
179
|
+
value: "uint64"
|
|
180
|
+
}
|
|
181
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
182
|
+
])(),
|
|
180
183
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
181
184
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
182
185
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
@@ -233,7 +236,7 @@ export const randomFile = generator => {
|
|
|
233
236
|
};
|
|
234
237
|
export const assertGuardFile = (input, errorFactory) => {
|
|
235
238
|
const __is = input => {
|
|
236
|
-
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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
239
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
237
240
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
238
241
|
const $io2 = input => "string" === typeof input.message;
|
|
239
242
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -249,7 +252,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
249
252
|
path: _path + ".id",
|
|
250
253
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
251
254
|
value: input.id
|
|
252
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
255
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
253
256
|
path: _path + ".size",
|
|
254
257
|
expected: "number & Minimum<0>",
|
|
255
258
|
value: input.size
|
|
@@ -259,7 +262,7 @@ export const assertGuardFile = (input, errorFactory) => {
|
|
|
259
262
|
value: input.size
|
|
260
263
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
261
264
|
path: _path + ".size",
|
|
262
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
265
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
263
266
|
value: input.size
|
|
264
267
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
265
268
|
path: _path + ".seekable",
|
|
@@ -384,13 +387,13 @@ export const stringifyFile = input => {
|
|
|
384
387
|
const $io2 = input => "string" === typeof input.message;
|
|
385
388
|
const $string = __typia.json.createStringify.string;
|
|
386
389
|
const $tail = __typia.json.createStringify.tail;
|
|
387
|
-
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(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
390
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
388
391
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
389
392
|
return $so0(input);
|
|
390
393
|
};
|
|
391
394
|
export const assertStringifyFile = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
392
395
|
const __is = input => {
|
|
393
|
-
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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
396
|
+
const $io0 = input => "string" === typeof input.id && /^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/.test(input.id) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
394
397
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
|
|
395
398
|
const $io2 = input => "string" === typeof input.message;
|
|
396
399
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -406,7 +409,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
406
409
|
path: _path + ".id",
|
|
407
410
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
408
411
|
value: input.id
|
|
409
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
412
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
410
413
|
path: _path + ".size",
|
|
411
414
|
expected: "number & Minimum<0>",
|
|
412
415
|
value: input.size
|
|
@@ -416,7 +419,7 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
416
419
|
value: input.size
|
|
417
420
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
418
421
|
path: _path + ".size",
|
|
419
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
422
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
420
423
|
value: input.size
|
|
421
424
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
422
425
|
path: _path + ".seekable",
|
|
@@ -541,19 +544,19 @@ export const assertStringifyFile = (input, errorFactory) => { const assert = (in
|
|
|
541
544
|
const $io2 = input => "string" === typeof input.message;
|
|
542
545
|
const $string = __typia.json.createAssertStringify.string;
|
|
543
546
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
544
|
-
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(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
547
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
545
548
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
546
549
|
return $so0(input);
|
|
547
550
|
}; return stringify(assert(input, errorFactory)); };
|
|
548
551
|
export const isFileStats = input => {
|
|
549
|
-
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
552
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
550
553
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
551
554
|
const $io2 = input => "string" === typeof input.message;
|
|
552
555
|
return "object" === typeof input && null !== input && $io0(input);
|
|
553
556
|
};
|
|
554
557
|
export const assertFileStats = (input, errorFactory) => {
|
|
555
558
|
const __is = input => {
|
|
556
|
-
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
559
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
557
560
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
558
561
|
const $io2 = input => "string" === typeof input.message;
|
|
559
562
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -609,7 +612,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
609
612
|
path: _path + ".id",
|
|
610
613
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
611
614
|
value: input.id
|
|
612
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
615
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
613
616
|
path: _path + ".size",
|
|
614
617
|
expected: "number & Minimum<0>",
|
|
615
618
|
value: input.size
|
|
@@ -619,7 +622,7 @@ export const assertFileStats = (input, errorFactory) => {
|
|
|
619
622
|
value: input.size
|
|
620
623
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
621
624
|
path: _path + ".size",
|
|
622
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
625
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
623
626
|
value: input.size
|
|
624
627
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
625
628
|
path: _path + ".seekable",
|
|
@@ -769,18 +772,21 @@ export const randomFileStats = generator => {
|
|
|
769
772
|
value: "^[0-9A-Za-z~][0-9A-Za-z~._: -]*$"
|
|
770
773
|
}
|
|
771
774
|
]) ?? (generator?.pattern ?? $generator.pattern)(/^[0-9A-Za-z~][0-9A-Za-z~._: -]*$/),
|
|
772
|
-
size:
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
775
|
+
size: $pick([
|
|
776
|
+
() => null,
|
|
777
|
+
() => (generator?.customs ?? $generator.customs)?.number?.([
|
|
778
|
+
{
|
|
779
|
+
name: "Minimum<0>",
|
|
780
|
+
kind: "minimum",
|
|
781
|
+
value: 0
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
name: "Type<\"uint64\">",
|
|
785
|
+
kind: "type",
|
|
786
|
+
value: "uint64"
|
|
787
|
+
}
|
|
788
|
+
]) ?? (generator?.integer ?? $generator.integer)(0, 10)
|
|
789
|
+
])(),
|
|
784
790
|
seekable: (generator?.boolean ?? $generator.boolean)(),
|
|
785
791
|
deleted: (generator?.boolean ?? $generator.boolean)(),
|
|
786
792
|
refs: (generator?.array ?? $generator.array)(() => $ro1(_recursive, _recursive ? 1 + _depth : _depth)),
|
|
@@ -837,7 +843,7 @@ export const randomFileStats = generator => {
|
|
|
837
843
|
};
|
|
838
844
|
export const assertGuardFileStats = (input, errorFactory) => {
|
|
839
845
|
const __is = input => {
|
|
840
|
-
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
846
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
841
847
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset) && (undefined === input.start || "number" === typeof input.start) && (undefined === input.end || "number" === typeof input.end);
|
|
842
848
|
const $io2 = input => "string" === typeof input.message;
|
|
843
849
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -893,7 +899,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
893
899
|
path: _path + ".id",
|
|
894
900
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
895
901
|
value: input.id
|
|
896
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
902
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
897
903
|
path: _path + ".size",
|
|
898
904
|
expected: "number & Minimum<0>",
|
|
899
905
|
value: input.size
|
|
@@ -903,7 +909,7 @@ export const assertGuardFileStats = (input, errorFactory) => {
|
|
|
903
909
|
value: input.size
|
|
904
910
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
905
911
|
path: _path + ".size",
|
|
906
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
912
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
907
913
|
value: input.size
|
|
908
914
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
909
915
|
path: _path + ".seekable",
|
|
@@ -1028,13 +1034,13 @@ export const stringifyFileStats = input => {
|
|
|
1028
1034
|
const $io2 = input => "string" === typeof input.message;
|
|
1029
1035
|
const $string = __typia.json.createStringify.string;
|
|
1030
1036
|
const $tail = __typia.json.createStringify.tail;
|
|
1031
|
-
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"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(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
1037
|
+
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
1032
1038
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
1033
1039
|
return $so0(input);
|
|
1034
1040
|
};
|
|
1035
1041
|
export const assertStringifyFileStats = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
1036
1042
|
const __is = input => {
|
|
1037
|
-
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
1043
|
+
const $io0 = input => (null === input.position || "number" === typeof input.position && (0 <= input.position && (Math.floor(input.position) === input.position && 0 <= input.position && input.position <= 18446744073709552000))) && "boolean" === typeof input.uploading && (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)) && (null === input.size || "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)) && "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))) && "boolean" === typeof input.completed && (null === input.error || Array.isArray(input.error) && input.error.every(elem => "object" === typeof elem && null !== elem && $io2(elem)));
|
|
1038
1044
|
const $io1 = input => (undefined === input.file || "string" === typeof input.file) && (undefined === input.offset || "number" === typeof input.offset && !Number.isNaN(input.offset)) && (undefined === input.start || "number" === typeof input.start && !Number.isNaN(input.start)) && (undefined === input.end || "number" === typeof input.end && !Number.isNaN(input.end));
|
|
1039
1045
|
const $io2 = input => "string" === typeof input.message;
|
|
1040
1046
|
return "object" === typeof input && null !== input && $io0(input);
|
|
@@ -1090,7 +1096,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1090
1096
|
path: _path + ".id",
|
|
1091
1097
|
expected: "(string & Pattern<\"^[0-9A-Za-z~][0-9A-Za-z~._: -]*$\">)",
|
|
1092
1098
|
value: input.id
|
|
1093
|
-
}, errorFactory)) && ("number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
1099
|
+
}, errorFactory)) && (null === input.size || "number" === typeof input.size && (0 <= input.size || $guard(_exceptionable, {
|
|
1094
1100
|
path: _path + ".size",
|
|
1095
1101
|
expected: "number & Minimum<0>",
|
|
1096
1102
|
value: input.size
|
|
@@ -1100,7 +1106,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1100
1106
|
value: input.size
|
|
1101
1107
|
}, errorFactory)) || $guard(_exceptionable, {
|
|
1102
1108
|
path: _path + ".size",
|
|
1103
|
-
expected: "(number & Minimum<0> & Type<\"uint64\">)",
|
|
1109
|
+
expected: "((number & Minimum<0> & Type<\"uint64\">) | null)",
|
|
1104
1110
|
value: input.size
|
|
1105
1111
|
}, errorFactory)) && ("boolean" === typeof input.seekable || $guard(_exceptionable, {
|
|
1106
1112
|
path: _path + ".seekable",
|
|
@@ -1225,7 +1231,7 @@ export const assertStringifyFileStats = (input, errorFactory) => { const assert
|
|
|
1225
1231
|
const $io2 = input => "string" === typeof input.message;
|
|
1226
1232
|
const $string = __typia.json.createAssertStringify.string;
|
|
1227
1233
|
const $tail = __typia.json.createAssertStringify.tail;
|
|
1228
|
-
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"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(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
1234
|
+
const $so0 = input => `{"position":${null !== input.position ? input.position : "null"},"uploading":${input.uploading},"zones":${`[${input.zones.map(elem => $string(elem)).join(",")}]`},"replicas":${`[${input.replicas.map(elem => $string(elem)).join(",")}]`},"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"seekable":${input.seekable},"deleted":${input.deleted},"refs":${`[${input.refs.map(elem => $so1(elem)).join(",")}]`},"tags":${`[${input.tags.map(elem => $string(elem)).join(",")}]`},"resumable":${$string(input.resumable)},"mimeType":${$string(input.mimeType)},"hash":${$string(input.hash)},"btime":${input.btime},"completed":${input.completed},"error":${null !== input.error ? `[${input.error.map(elem => `{"message":${$string(elem.message)}}`).join(",")}]` : "null"}}`;
|
|
1229
1235
|
const $so1 = input => `{${$tail(`${undefined === input.file ? "" : `"file":${undefined !== input.file ? $string(input.file) : undefined},`}${undefined === input.offset ? "" : `"offset":${undefined !== input.offset ? input.offset : undefined},`}${undefined === input.start ? "" : `"start":${undefined !== input.start ? input.start : undefined},`}${undefined === input.end ? "" : `"end":${undefined !== input.end ? input.end : undefined}`}`)}}`;
|
|
1230
1236
|
return $so0(input);
|
|
1231
1237
|
}; return stringify(assert(input, errorFactory)); };
|