@nxtedition/types 1.2.6 → 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.
@@ -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
- capcity: number | null;
6
+ capacity: 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[];
@@ -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.title || "string" === typeof input.title) && (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) && "number" === typeof input.limit && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
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.title || "string" === typeof input.title) && (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) && "number" === typeof input.limit && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
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))
@@ -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)",
@@ -27,10 +23,10 @@ export const assertLocation = (input, errorFactory) => {
27
23
  path: _path + ".free",
28
24
  expected: "(null | number)",
29
25
  value: input.free
30
- }, errorFactory)) && (null === input.capcity || "number" === typeof input.capcity || $guard(_exceptionable, {
31
- path: _path + ".capcity",
26
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
27
+ path: _path + ".capacity",
32
28
  expected: "(null | number)",
33
- value: input.capcity
29
+ value: input.capacity
34
30
  }, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
35
31
  path: _path + ".available",
36
32
  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)
@@ -93,7 +81,7 @@ export const randomLocation = generator => {
93
81
  () => null,
94
82
  () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
95
83
  ])(),
96
- capcity: $pick([
84
+ capacity: $pick([
97
85
  () => null,
98
86
  () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
99
87
  ])(),
@@ -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.title || "string" === typeof input.title) && (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) && "number" === typeof input.limit && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
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));
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)",
@@ -136,10 +119,10 @@ export const assertGuardLocation = (input, errorFactory) => {
136
119
  path: _path + ".free",
137
120
  expected: "(null | number)",
138
121
  value: input.free
139
- }, errorFactory)) && (null === input.capcity || "number" === typeof input.capcity || $guard(_exceptionable, {
140
- path: _path + ".capcity",
122
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
123
+ path: _path + ".capacity",
141
124
  expected: "(null | number)",
142
- value: input.capcity
125
+ value: input.capacity
143
126
  }, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
144
127
  path: _path + ".available",
145
128
  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)},"title":${null !== input.title ? $string(input.title) : "null"},"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"},"limit":${input.limit},"origin":${$string(input.origin)},"zone":${$string(input.zone)},"allows":${`[${input.allows.map(elem => $string(elem)).join(",")}]`}}`;
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(",")}]`}}`;
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.title || "string" === typeof input.title) && (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) && ("number" === typeof input.limit && !Number.isNaN(input.limit)) && "string" === typeof input.origin && "string" === typeof input.zone && (Array.isArray(input.allows) && input.allows.every(elem => "string" === typeof elem));
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));
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)",
@@ -213,10 +188,10 @@ export const assertStringifyLocation = (input, errorFactory) => { const assert =
213
188
  path: _path + ".free",
214
189
  expected: "(null | number)",
215
190
  value: input.free
216
- }, errorFactory)) && (null === input.capcity || "number" === typeof input.capcity && !Number.isNaN(input.capcity) || $guard(_exceptionable, {
217
- path: _path + ".capcity",
191
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity) || $guard(_exceptionable, {
192
+ path: _path + ".capacity",
218
193
  expected: "(null | number)",
219
- value: input.capcity
194
+ value: input.capacity
220
195
  }, errorFactory)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available) || $guard(_exceptionable, {
221
196
  path: _path + ".available",
222
197
  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)},"title":${null !== input.title ? $string(input.title) : "null"},"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"},"limit":${input.limit},"origin":${$string(input.origin)},"zone":${$string(input.zone)},"allows":${`[${input.allows.map(elem => $string(elem)).join(",")}]`}}`;
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(",")}]`}}`;
267
238
  return $so0(input);
268
239
  }; return stringify(assert(input, errorFactory)); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/types",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "prepare": "ts-patch install && typia patch",