@nxtedition/types 1.2.6 → 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/location.d.ts +0 -2
- package/dist/common/location.js +6 -35
- package/package.json +1 -1
|
@@ -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)); };
|