@nxtedition/types 1.2.7 → 1.2.8
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/location.d.ts +1 -1
- package/dist/common/location.js +16 -16
- package/package.json +1 -1
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.size || "number" === typeof input.size) && (null === input.free || "number" === typeof input.free) && (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.capacity || "number" === typeof input.capacity) && (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.size || "number" === typeof input.size) && (null === input.free || "number" === typeof input.free) && (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.capacity || "number" === typeof input.capacity) && (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))
|
|
@@ -23,10 +23,10 @@ export const assertLocation = (input, errorFactory) => {
|
|
|
23
23
|
path: _path + ".free",
|
|
24
24
|
expected: "(null | number)",
|
|
25
25
|
value: input.free
|
|
26
|
-
}, errorFactory)) && (null === input.
|
|
27
|
-
path: _path + ".
|
|
26
|
+
}, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
|
|
27
|
+
path: _path + ".capacity",
|
|
28
28
|
expected: "(null | number)",
|
|
29
|
-
value: input.
|
|
29
|
+
value: input.capacity
|
|
30
30
|
}, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
|
|
31
31
|
path: _path + ".available",
|
|
32
32
|
expected: "(null | number)",
|
|
@@ -81,7 +81,7 @@ export const randomLocation = generator => {
|
|
|
81
81
|
() => null,
|
|
82
82
|
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
83
83
|
])(),
|
|
84
|
-
|
|
84
|
+
capacity: $pick([
|
|
85
85
|
() => null,
|
|
86
86
|
() => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
|
|
87
87
|
])(),
|
|
@@ -101,7 +101,7 @@ export const randomLocation = generator => {
|
|
|
101
101
|
};
|
|
102
102
|
export const assertGuardLocation = (input, errorFactory) => {
|
|
103
103
|
const __is = 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.
|
|
104
|
+
const $io0 = input => "string" === typeof input.id && (null === input.size || "number" === typeof input.size) && (null === input.free || "number" === typeof input.free) && (null === input.capacity || "number" === typeof input.capacity) && (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));
|
|
105
105
|
return "object" === typeof input && null !== input && $io0(input);
|
|
106
106
|
};
|
|
107
107
|
if (false === __is(input))
|
|
@@ -119,10 +119,10 @@ export const assertGuardLocation = (input, errorFactory) => {
|
|
|
119
119
|
path: _path + ".free",
|
|
120
120
|
expected: "(null | number)",
|
|
121
121
|
value: input.free
|
|
122
|
-
}, errorFactory)) && (null === input.
|
|
123
|
-
path: _path + ".
|
|
122
|
+
}, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
|
|
123
|
+
path: _path + ".capacity",
|
|
124
124
|
expected: "(null | number)",
|
|
125
|
-
value: input.
|
|
125
|
+
value: input.capacity
|
|
126
126
|
}, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
|
|
127
127
|
path: _path + ".available",
|
|
128
128
|
expected: "(null | number)",
|
|
@@ -165,12 +165,12 @@ export const assertGuardLocation = (input, errorFactory) => {
|
|
|
165
165
|
};
|
|
166
166
|
export const stringifyLocation = input => {
|
|
167
167
|
const $string = __typia.json.createStringify.string;
|
|
168
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"free":${null !== input.free ? input.free : "null"},"
|
|
168
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"free":${null !== input.free ? input.free : "null"},"capacity":${null !== input.capacity ? input.capacity : "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(",")}]`}}`;
|
|
169
169
|
return $so0(input);
|
|
170
170
|
};
|
|
171
171
|
export const assertStringifyLocation = (input, errorFactory) => { const assert = (input, errorFactory) => {
|
|
172
172
|
const __is = 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.
|
|
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.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity)) && (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));
|
|
174
174
|
return "object" === typeof input && null !== input && $io0(input);
|
|
175
175
|
};
|
|
176
176
|
if (false === __is(input))
|
|
@@ -188,10 +188,10 @@ export const assertStringifyLocation = (input, errorFactory) => { const assert =
|
|
|
188
188
|
path: _path + ".free",
|
|
189
189
|
expected: "(null | number)",
|
|
190
190
|
value: input.free
|
|
191
|
-
}, errorFactory)) && (null === input.
|
|
192
|
-
path: _path + ".
|
|
191
|
+
}, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity) || $guard(_exceptionable, {
|
|
192
|
+
path: _path + ".capacity",
|
|
193
193
|
expected: "(null | number)",
|
|
194
|
-
value: input.
|
|
194
|
+
value: input.capacity
|
|
195
195
|
}, errorFactory)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available) || $guard(_exceptionable, {
|
|
196
196
|
path: _path + ".available",
|
|
197
197
|
expected: "(null | number)",
|
|
@@ -234,6 +234,6 @@ export const assertStringifyLocation = (input, errorFactory) => { const assert =
|
|
|
234
234
|
return input;
|
|
235
235
|
}; const stringify = input => {
|
|
236
236
|
const $string = __typia.json.createAssertStringify.string;
|
|
237
|
-
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"free":${null !== input.free ? input.free : "null"},"
|
|
237
|
+
const $so0 = input => `{"id":${$string(input.id)},"size":${null !== input.size ? input.size : "null"},"free":${null !== input.free ? input.free : "null"},"capacity":${null !== input.capacity ? input.capacity : "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(",")}]`}}`;
|
|
238
238
|
return $so0(input);
|
|
239
239
|
}; return stringify(assert(input, errorFactory)); };
|