@nxtedition/types 23.0.35 → 23.0.38

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.
@@ -0,0 +1,1036 @@
1
+ import __typia from "typia";
2
+ export const isStorageLocationsRecord = input => {
3
+ const $io0 = input => Object.keys(input).every(key => {
4
+ const value = input[key];
5
+ if (undefined === value)
6
+ return true;
7
+ return "object" === typeof value && null !== value && $io1(value);
8
+ });
9
+ const $io1 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && "number" === typeof input.net.tx)) && "number" === typeof input.latency;
10
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
11
+ };
12
+ export const assertStorageLocationsRecord = (input, errorFactory) => {
13
+ const __is = input => {
14
+ const $io0 = input => Object.keys(input).every(key => {
15
+ const value = input[key];
16
+ if (undefined === value)
17
+ return true;
18
+ return "object" === typeof value && null !== value && $io1(value);
19
+ });
20
+ const $io1 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && "number" === typeof input.net.tx)) && "number" === typeof input.latency;
21
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
22
+ };
23
+ if (false === __is(input))
24
+ ((input, _path, _exceptionable = true) => {
25
+ const $guard = __typia.createAssert.guard;
26
+ const $join = __typia.createAssert.join;
27
+ const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
28
+ const value = input[key];
29
+ if (undefined === value)
30
+ return true;
31
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
32
+ path: _path + $join(key),
33
+ expected: "StorageLocationsRecordEntry",
34
+ value: value
35
+ }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
36
+ path: _path + $join(key),
37
+ expected: "StorageLocationsRecordEntry",
38
+ value: value
39
+ }, errorFactory);
40
+ });
41
+ const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
42
+ path: _path + ".id",
43
+ expected: "string",
44
+ value: input.id
45
+ }, errorFactory)) && ("string" === typeof input.location || $guard(_exceptionable, {
46
+ path: _path + ".location",
47
+ expected: "string",
48
+ value: input.location
49
+ }, errorFactory)) && ("string" === typeof input.timestamp || $guard(_exceptionable, {
50
+ path: _path + ".timestamp",
51
+ expected: "string",
52
+ value: input.timestamp
53
+ }, errorFactory)) && ("string" === typeof input.type || $guard(_exceptionable, {
54
+ path: _path + ".type",
55
+ expected: "string",
56
+ value: input.type
57
+ }, errorFactory)) && ("string" === typeof input.zone || $guard(_exceptionable, {
58
+ path: _path + ".zone",
59
+ expected: "string",
60
+ value: input.zone
61
+ }, errorFactory)) && (null === input.free || "number" === typeof input.free || $guard(_exceptionable, {
62
+ path: _path + ".free",
63
+ expected: "(null | number)",
64
+ value: input.free
65
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size || $guard(_exceptionable, {
66
+ path: _path + ".size",
67
+ expected: "(null | number)",
68
+ value: input.size
69
+ }, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
70
+ path: _path + ".available",
71
+ expected: "(null | number)",
72
+ value: input.available
73
+ }, errorFactory)) && (null === input.cache || "boolean" === typeof input.cache || $guard(_exceptionable, {
74
+ path: _path + ".cache",
75
+ expected: "(boolean | null)",
76
+ value: input.cache
77
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
78
+ path: _path + ".capacity",
79
+ expected: "(null | number)",
80
+ value: input.capacity
81
+ }, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
82
+ path: _path + ".origin",
83
+ expected: "string",
84
+ value: input.origin
85
+ }, errorFactory)) && ((Array.isArray(input.allows) || $guard(_exceptionable, {
86
+ path: _path + ".allows",
87
+ expected: "Array<\"get\" | \"put\" | \"del\">",
88
+ value: input.allows
89
+ }, errorFactory)) && input.allows.every((elem, _index1) => "get" === elem || "put" === elem || "del" === elem || $guard(_exceptionable, {
90
+ path: _path + ".allows[" + _index1 + "]",
91
+ expected: "(\"del\" | \"get\" | \"put\")",
92
+ value: elem
93
+ }, errorFactory)) || $guard(_exceptionable, {
94
+ path: _path + ".allows",
95
+ expected: "Array<\"get\" | \"put\" | \"del\">",
96
+ value: input.allows
97
+ }, errorFactory)) && (("object" === typeof input.net && null !== input.net || $guard(_exceptionable, {
98
+ path: _path + ".net",
99
+ expected: "__type",
100
+ value: input.net
101
+ }, errorFactory)) && $ao2(input.net, _path + ".net", true && _exceptionable) || $guard(_exceptionable, {
102
+ path: _path + ".net",
103
+ expected: "__type",
104
+ value: input.net
105
+ }, errorFactory)) && ("number" === typeof input.latency || $guard(_exceptionable, {
106
+ path: _path + ".latency",
107
+ expected: "number",
108
+ value: input.latency
109
+ }, errorFactory));
110
+ const $ao2 = (input, _path, _exceptionable = true) => ("number" === typeof input.rx || $guard(_exceptionable, {
111
+ path: _path + ".rx",
112
+ expected: "number",
113
+ value: input.rx
114
+ }, errorFactory)) && ("number" === typeof input.tx || $guard(_exceptionable, {
115
+ path: _path + ".tx",
116
+ expected: "number",
117
+ value: input.tx
118
+ }, errorFactory));
119
+ return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
120
+ path: _path + "",
121
+ expected: "StorageLocationsRecord",
122
+ value: input
123
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
124
+ path: _path + "",
125
+ expected: "StorageLocationsRecord",
126
+ value: input
127
+ }, errorFactory);
128
+ })(input, "$input", true);
129
+ return input;
130
+ };
131
+ export const randomStorageLocationsRecord = generator => {
132
+ const $generator = __typia.createRandom.generator;
133
+ const $pick = __typia.createRandom.pick;
134
+ const $ro0 = (_recursive = false, _depth = 0) => {
135
+ const output = {};
136
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = $ro1(_recursive, _recursive ? 1 + _depth : _depth), (generator?.integer ?? $generator.integer)(0, 3));
137
+ return output;
138
+ };
139
+ const $ro1 = (_recursive = false, _depth = 0) => ({
140
+ id: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
141
+ location: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
142
+ timestamp: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
143
+ type: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
144
+ zone: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
145
+ free: $pick([
146
+ () => null,
147
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
148
+ ])(),
149
+ size: $pick([
150
+ () => null,
151
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
152
+ ])(),
153
+ available: $pick([
154
+ () => null,
155
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
156
+ ])(),
157
+ cache: $pick([
158
+ () => null,
159
+ () => (generator?.boolean ?? $generator.boolean)()
160
+ ])(),
161
+ capacity: $pick([
162
+ () => null,
163
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
164
+ ])(),
165
+ origin: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
166
+ allows: (generator?.array ?? $generator.array)(() => $pick([
167
+ () => "get",
168
+ () => "put",
169
+ () => "del"
170
+ ])()),
171
+ net: $ro2(_recursive, _recursive ? 1 + _depth : _depth),
172
+ latency: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
173
+ });
174
+ const $ro2 = (_recursive = false, _depth = 0) => ({
175
+ rx: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
176
+ tx: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
177
+ });
178
+ return $ro0();
179
+ };
180
+ export const assertGuardStorageLocationsRecord = (input, errorFactory) => {
181
+ const __is = input => {
182
+ const $io0 = input => Object.keys(input).every(key => {
183
+ const value = input[key];
184
+ if (undefined === value)
185
+ return true;
186
+ return "object" === typeof value && null !== value && $io1(value);
187
+ });
188
+ const $io1 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && "number" === typeof input.net.tx)) && "number" === typeof input.latency;
189
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
190
+ };
191
+ if (false === __is(input))
192
+ ((input, _path, _exceptionable = true) => {
193
+ const $guard = __typia.createAssertGuard.guard;
194
+ const $join = __typia.createAssertGuard.join;
195
+ const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
196
+ const value = input[key];
197
+ if (undefined === value)
198
+ return true;
199
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
200
+ path: _path + $join(key),
201
+ expected: "StorageLocationsRecordEntry",
202
+ value: value
203
+ }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
204
+ path: _path + $join(key),
205
+ expected: "StorageLocationsRecordEntry",
206
+ value: value
207
+ }, errorFactory);
208
+ });
209
+ const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
210
+ path: _path + ".id",
211
+ expected: "string",
212
+ value: input.id
213
+ }, errorFactory)) && ("string" === typeof input.location || $guard(_exceptionable, {
214
+ path: _path + ".location",
215
+ expected: "string",
216
+ value: input.location
217
+ }, errorFactory)) && ("string" === typeof input.timestamp || $guard(_exceptionable, {
218
+ path: _path + ".timestamp",
219
+ expected: "string",
220
+ value: input.timestamp
221
+ }, errorFactory)) && ("string" === typeof input.type || $guard(_exceptionable, {
222
+ path: _path + ".type",
223
+ expected: "string",
224
+ value: input.type
225
+ }, errorFactory)) && ("string" === typeof input.zone || $guard(_exceptionable, {
226
+ path: _path + ".zone",
227
+ expected: "string",
228
+ value: input.zone
229
+ }, errorFactory)) && (null === input.free || "number" === typeof input.free || $guard(_exceptionable, {
230
+ path: _path + ".free",
231
+ expected: "(null | number)",
232
+ value: input.free
233
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size || $guard(_exceptionable, {
234
+ path: _path + ".size",
235
+ expected: "(null | number)",
236
+ value: input.size
237
+ }, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
238
+ path: _path + ".available",
239
+ expected: "(null | number)",
240
+ value: input.available
241
+ }, errorFactory)) && (null === input.cache || "boolean" === typeof input.cache || $guard(_exceptionable, {
242
+ path: _path + ".cache",
243
+ expected: "(boolean | null)",
244
+ value: input.cache
245
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
246
+ path: _path + ".capacity",
247
+ expected: "(null | number)",
248
+ value: input.capacity
249
+ }, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
250
+ path: _path + ".origin",
251
+ expected: "string",
252
+ value: input.origin
253
+ }, errorFactory)) && ((Array.isArray(input.allows) || $guard(_exceptionable, {
254
+ path: _path + ".allows",
255
+ expected: "Array<\"get\" | \"put\" | \"del\">",
256
+ value: input.allows
257
+ }, errorFactory)) && input.allows.every((elem, _index1) => "get" === elem || "put" === elem || "del" === elem || $guard(_exceptionable, {
258
+ path: _path + ".allows[" + _index1 + "]",
259
+ expected: "(\"del\" | \"get\" | \"put\")",
260
+ value: elem
261
+ }, errorFactory)) || $guard(_exceptionable, {
262
+ path: _path + ".allows",
263
+ expected: "Array<\"get\" | \"put\" | \"del\">",
264
+ value: input.allows
265
+ }, errorFactory)) && (("object" === typeof input.net && null !== input.net || $guard(_exceptionable, {
266
+ path: _path + ".net",
267
+ expected: "__type",
268
+ value: input.net
269
+ }, errorFactory)) && $ao2(input.net, _path + ".net", true && _exceptionable) || $guard(_exceptionable, {
270
+ path: _path + ".net",
271
+ expected: "__type",
272
+ value: input.net
273
+ }, errorFactory)) && ("number" === typeof input.latency || $guard(_exceptionable, {
274
+ path: _path + ".latency",
275
+ expected: "number",
276
+ value: input.latency
277
+ }, errorFactory));
278
+ const $ao2 = (input, _path, _exceptionable = true) => ("number" === typeof input.rx || $guard(_exceptionable, {
279
+ path: _path + ".rx",
280
+ expected: "number",
281
+ value: input.rx
282
+ }, errorFactory)) && ("number" === typeof input.tx || $guard(_exceptionable, {
283
+ path: _path + ".tx",
284
+ expected: "number",
285
+ value: input.tx
286
+ }, errorFactory));
287
+ return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
288
+ path: _path + "",
289
+ expected: "StorageLocationsRecord",
290
+ value: input
291
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
292
+ path: _path + "",
293
+ expected: "StorageLocationsRecord",
294
+ value: input
295
+ }, errorFactory);
296
+ })(input, "$input", true);
297
+ };
298
+ export const stringifyStorageLocationsRecord = input => {
299
+ const $io1 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && $io2(input.net)) && "number" === typeof input.latency;
300
+ const $io2 = input => "number" === typeof input.rx && "number" === typeof input.tx;
301
+ const $string = __typia.json.createStringify.string;
302
+ const $throws = __typia.json.createStringify.throws;
303
+ const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
304
+ return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
305
+ const $so1 = input => `{"id":${$string(input.id)},"location":${$string(input.location)},"timestamp":${$string(input.timestamp)},"type":${$string(input.type)},"zone":${$string(input.zone)},"free":${null !== input.free ? input.free : "null"},"size":${null !== input.size ? input.size : "null"},"available":${null !== input.available ? input.available : "null"},"cache":${null !== input.cache ? input.cache : "null"},"capacity":${null !== input.capacity ? input.capacity : "null"},"origin":${$string(input.origin)},"allows":${`[${input.allows.map(elem => (() => {
306
+ if ("string" === typeof elem)
307
+ return $string(elem);
308
+ if ("string" === typeof elem)
309
+ return "\"" + elem + "\"";
310
+ $throws({
311
+ expected: "(\"del\" | \"get\" | \"put\")",
312
+ value: elem
313
+ });
314
+ })()).join(",")}]`},"net":${`{"rx":${input.net.rx},"tx":${input.net.tx}}`},"latency":${input.latency}}`;
315
+ return $so0(input);
316
+ };
317
+ export const assertStringifyStorageLocationsRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
318
+ const __is = input => {
319
+ const $io0 = input => Object.keys(input).every(key => {
320
+ const value = input[key];
321
+ if (undefined === value)
322
+ return true;
323
+ return "object" === typeof value && null !== value && $io1(value);
324
+ });
325
+ const $io1 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free && !Number.isNaN(input.free)) && (null === input.size || "number" === typeof input.size && !Number.isNaN(input.size)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available)) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity)) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && !Number.isNaN(input.net.rx) && ("number" === typeof input.net.tx && !Number.isNaN(input.net.tx)))) && ("number" === typeof input.latency && !Number.isNaN(input.latency));
326
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
327
+ };
328
+ if (false === __is(input))
329
+ ((input, _path, _exceptionable = true) => {
330
+ const $guard = __typia.json.createAssertStringify.guard;
331
+ const $join = __typia.json.createAssertStringify.join;
332
+ const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
333
+ const value = input[key];
334
+ if (undefined === value)
335
+ return true;
336
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
337
+ path: _path + $join(key),
338
+ expected: "StorageLocationsRecordEntry",
339
+ value: value
340
+ }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
341
+ path: _path + $join(key),
342
+ expected: "StorageLocationsRecordEntry",
343
+ value: value
344
+ }, errorFactory);
345
+ });
346
+ const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
347
+ path: _path + ".id",
348
+ expected: "string",
349
+ value: input.id
350
+ }, errorFactory)) && ("string" === typeof input.location || $guard(_exceptionable, {
351
+ path: _path + ".location",
352
+ expected: "string",
353
+ value: input.location
354
+ }, errorFactory)) && ("string" === typeof input.timestamp || $guard(_exceptionable, {
355
+ path: _path + ".timestamp",
356
+ expected: "string",
357
+ value: input.timestamp
358
+ }, errorFactory)) && ("string" === typeof input.type || $guard(_exceptionable, {
359
+ path: _path + ".type",
360
+ expected: "string",
361
+ value: input.type
362
+ }, errorFactory)) && ("string" === typeof input.zone || $guard(_exceptionable, {
363
+ path: _path + ".zone",
364
+ expected: "string",
365
+ value: input.zone
366
+ }, errorFactory)) && (null === input.free || "number" === typeof input.free && !Number.isNaN(input.free) || $guard(_exceptionable, {
367
+ path: _path + ".free",
368
+ expected: "(null | number)",
369
+ value: input.free
370
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && !Number.isNaN(input.size) || $guard(_exceptionable, {
371
+ path: _path + ".size",
372
+ expected: "(null | number)",
373
+ value: input.size
374
+ }, errorFactory)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available) || $guard(_exceptionable, {
375
+ path: _path + ".available",
376
+ expected: "(null | number)",
377
+ value: input.available
378
+ }, errorFactory)) && (null === input.cache || "boolean" === typeof input.cache || $guard(_exceptionable, {
379
+ path: _path + ".cache",
380
+ expected: "(boolean | null)",
381
+ value: input.cache
382
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity) || $guard(_exceptionable, {
383
+ path: _path + ".capacity",
384
+ expected: "(null | number)",
385
+ value: input.capacity
386
+ }, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
387
+ path: _path + ".origin",
388
+ expected: "string",
389
+ value: input.origin
390
+ }, errorFactory)) && ((Array.isArray(input.allows) || $guard(_exceptionable, {
391
+ path: _path + ".allows",
392
+ expected: "Array<\"get\" | \"put\" | \"del\">",
393
+ value: input.allows
394
+ }, errorFactory)) && input.allows.every((elem, _index1) => "get" === elem || "put" === elem || "del" === elem || $guard(_exceptionable, {
395
+ path: _path + ".allows[" + _index1 + "]",
396
+ expected: "(\"del\" | \"get\" | \"put\")",
397
+ value: elem
398
+ }, errorFactory)) || $guard(_exceptionable, {
399
+ path: _path + ".allows",
400
+ expected: "Array<\"get\" | \"put\" | \"del\">",
401
+ value: input.allows
402
+ }, errorFactory)) && (("object" === typeof input.net && null !== input.net || $guard(_exceptionable, {
403
+ path: _path + ".net",
404
+ expected: "__type",
405
+ value: input.net
406
+ }, errorFactory)) && $ao2(input.net, _path + ".net", true && _exceptionable) || $guard(_exceptionable, {
407
+ path: _path + ".net",
408
+ expected: "__type",
409
+ value: input.net
410
+ }, errorFactory)) && ("number" === typeof input.latency && !Number.isNaN(input.latency) || $guard(_exceptionable, {
411
+ path: _path + ".latency",
412
+ expected: "number",
413
+ value: input.latency
414
+ }, errorFactory));
415
+ const $ao2 = (input, _path, _exceptionable = true) => ("number" === typeof input.rx && !Number.isNaN(input.rx) || $guard(_exceptionable, {
416
+ path: _path + ".rx",
417
+ expected: "number",
418
+ value: input.rx
419
+ }, errorFactory)) && ("number" === typeof input.tx && !Number.isNaN(input.tx) || $guard(_exceptionable, {
420
+ path: _path + ".tx",
421
+ expected: "number",
422
+ value: input.tx
423
+ }, errorFactory));
424
+ return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
425
+ path: _path + "",
426
+ expected: "StorageLocationsRecord",
427
+ value: input
428
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
429
+ path: _path + "",
430
+ expected: "StorageLocationsRecord",
431
+ value: input
432
+ }, errorFactory);
433
+ })(input, "$input", true);
434
+ return input;
435
+ }; const stringify = input => {
436
+ const $io1 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && $io2(input.net)) && "number" === typeof input.latency;
437
+ const $io2 = input => "number" === typeof input.rx && "number" === typeof input.tx;
438
+ const $string = __typia.json.createAssertStringify.string;
439
+ const $throws = __typia.json.createAssertStringify.throws;
440
+ const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
441
+ return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
442
+ const $so1 = input => `{"id":${$string(input.id)},"location":${$string(input.location)},"timestamp":${$string(input.timestamp)},"type":${$string(input.type)},"zone":${$string(input.zone)},"free":${null !== input.free ? input.free : "null"},"size":${null !== input.size ? input.size : "null"},"available":${null !== input.available ? input.available : "null"},"cache":${null !== input.cache ? input.cache : "null"},"capacity":${null !== input.capacity ? input.capacity : "null"},"origin":${$string(input.origin)},"allows":${`[${input.allows.map(elem => (() => {
443
+ if ("string" === typeof elem)
444
+ return $string(elem);
445
+ if ("string" === typeof elem)
446
+ return "\"" + elem + "\"";
447
+ $throws({
448
+ expected: "(\"del\" | \"get\" | \"put\")",
449
+ value: elem
450
+ });
451
+ })()).join(",")}]`},"net":${`{"rx":${input.net.rx},"tx":${input.net.tx}}`},"latency":${input.latency}}`;
452
+ return $so0(input);
453
+ }; return stringify(assert(input, errorFactory)); };
454
+ export const isStorageLocationsRecordEntry = input => {
455
+ const $io0 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && "number" === typeof input.net.tx)) && "number" === typeof input.latency;
456
+ return "object" === typeof input && null !== input && $io0(input);
457
+ };
458
+ export const assertStorageLocationsRecordEntry = (input, errorFactory) => {
459
+ const __is = input => {
460
+ const $io0 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && "number" === typeof input.net.tx)) && "number" === typeof input.latency;
461
+ return "object" === typeof input && null !== input && $io0(input);
462
+ };
463
+ if (false === __is(input))
464
+ ((input, _path, _exceptionable = true) => {
465
+ const $guard = __typia.createAssert.guard;
466
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
467
+ path: _path + ".id",
468
+ expected: "string",
469
+ value: input.id
470
+ }, errorFactory)) && ("string" === typeof input.location || $guard(_exceptionable, {
471
+ path: _path + ".location",
472
+ expected: "string",
473
+ value: input.location
474
+ }, errorFactory)) && ("string" === typeof input.timestamp || $guard(_exceptionable, {
475
+ path: _path + ".timestamp",
476
+ expected: "string",
477
+ value: input.timestamp
478
+ }, errorFactory)) && ("string" === typeof input.type || $guard(_exceptionable, {
479
+ path: _path + ".type",
480
+ expected: "string",
481
+ value: input.type
482
+ }, errorFactory)) && ("string" === typeof input.zone || $guard(_exceptionable, {
483
+ path: _path + ".zone",
484
+ expected: "string",
485
+ value: input.zone
486
+ }, errorFactory)) && (null === input.free || "number" === typeof input.free || $guard(_exceptionable, {
487
+ path: _path + ".free",
488
+ expected: "(null | number)",
489
+ value: input.free
490
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size || $guard(_exceptionable, {
491
+ path: _path + ".size",
492
+ expected: "(null | number)",
493
+ value: input.size
494
+ }, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
495
+ path: _path + ".available",
496
+ expected: "(null | number)",
497
+ value: input.available
498
+ }, errorFactory)) && (null === input.cache || "boolean" === typeof input.cache || $guard(_exceptionable, {
499
+ path: _path + ".cache",
500
+ expected: "(boolean | null)",
501
+ value: input.cache
502
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
503
+ path: _path + ".capacity",
504
+ expected: "(null | number)",
505
+ value: input.capacity
506
+ }, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
507
+ path: _path + ".origin",
508
+ expected: "string",
509
+ value: input.origin
510
+ }, errorFactory)) && ((Array.isArray(input.allows) || $guard(_exceptionable, {
511
+ path: _path + ".allows",
512
+ expected: "Array<\"get\" | \"put\" | \"del\">",
513
+ value: input.allows
514
+ }, errorFactory)) && input.allows.every((elem, _index1) => "get" === elem || "put" === elem || "del" === elem || $guard(_exceptionable, {
515
+ path: _path + ".allows[" + _index1 + "]",
516
+ expected: "(\"del\" | \"get\" | \"put\")",
517
+ value: elem
518
+ }, errorFactory)) || $guard(_exceptionable, {
519
+ path: _path + ".allows",
520
+ expected: "Array<\"get\" | \"put\" | \"del\">",
521
+ value: input.allows
522
+ }, errorFactory)) && (("object" === typeof input.net && null !== input.net || $guard(_exceptionable, {
523
+ path: _path + ".net",
524
+ expected: "__type",
525
+ value: input.net
526
+ }, errorFactory)) && $ao1(input.net, _path + ".net", true && _exceptionable) || $guard(_exceptionable, {
527
+ path: _path + ".net",
528
+ expected: "__type",
529
+ value: input.net
530
+ }, errorFactory)) && ("number" === typeof input.latency || $guard(_exceptionable, {
531
+ path: _path + ".latency",
532
+ expected: "number",
533
+ value: input.latency
534
+ }, errorFactory));
535
+ const $ao1 = (input, _path, _exceptionable = true) => ("number" === typeof input.rx || $guard(_exceptionable, {
536
+ path: _path + ".rx",
537
+ expected: "number",
538
+ value: input.rx
539
+ }, errorFactory)) && ("number" === typeof input.tx || $guard(_exceptionable, {
540
+ path: _path + ".tx",
541
+ expected: "number",
542
+ value: input.tx
543
+ }, errorFactory));
544
+ return ("object" === typeof input && null !== input || $guard(true, {
545
+ path: _path + "",
546
+ expected: "StorageLocationsRecordEntry",
547
+ value: input
548
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
549
+ path: _path + "",
550
+ expected: "StorageLocationsRecordEntry",
551
+ value: input
552
+ }, errorFactory);
553
+ })(input, "$input", true);
554
+ return input;
555
+ };
556
+ export const randomStorageLocationsRecordEntry = generator => {
557
+ const $generator = __typia.createRandom.generator;
558
+ const $pick = __typia.createRandom.pick;
559
+ const $ro0 = (_recursive = false, _depth = 0) => ({
560
+ id: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
561
+ location: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
562
+ timestamp: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
563
+ type: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
564
+ zone: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
565
+ free: $pick([
566
+ () => null,
567
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
568
+ ])(),
569
+ size: $pick([
570
+ () => null,
571
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
572
+ ])(),
573
+ available: $pick([
574
+ () => null,
575
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
576
+ ])(),
577
+ cache: $pick([
578
+ () => null,
579
+ () => (generator?.boolean ?? $generator.boolean)()
580
+ ])(),
581
+ capacity: $pick([
582
+ () => null,
583
+ () => (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
584
+ ])(),
585
+ origin: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
586
+ allows: (generator?.array ?? $generator.array)(() => $pick([
587
+ () => "get",
588
+ () => "put",
589
+ () => "del"
590
+ ])()),
591
+ net: $ro1(_recursive, _recursive ? 1 + _depth : _depth),
592
+ latency: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
593
+ });
594
+ const $ro1 = (_recursive = false, _depth = 0) => ({
595
+ rx: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
596
+ tx: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100)
597
+ });
598
+ return $ro0();
599
+ };
600
+ export const assertGuardStorageLocationsRecordEntry = (input, errorFactory) => {
601
+ const __is = input => {
602
+ const $io0 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free) && (null === input.size || "number" === typeof input.size) && (null === input.available || "number" === typeof input.available) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && "number" === typeof input.net.tx)) && "number" === typeof input.latency;
603
+ return "object" === typeof input && null !== input && $io0(input);
604
+ };
605
+ if (false === __is(input))
606
+ ((input, _path, _exceptionable = true) => {
607
+ const $guard = __typia.createAssertGuard.guard;
608
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
609
+ path: _path + ".id",
610
+ expected: "string",
611
+ value: input.id
612
+ }, errorFactory)) && ("string" === typeof input.location || $guard(_exceptionable, {
613
+ path: _path + ".location",
614
+ expected: "string",
615
+ value: input.location
616
+ }, errorFactory)) && ("string" === typeof input.timestamp || $guard(_exceptionable, {
617
+ path: _path + ".timestamp",
618
+ expected: "string",
619
+ value: input.timestamp
620
+ }, errorFactory)) && ("string" === typeof input.type || $guard(_exceptionable, {
621
+ path: _path + ".type",
622
+ expected: "string",
623
+ value: input.type
624
+ }, errorFactory)) && ("string" === typeof input.zone || $guard(_exceptionable, {
625
+ path: _path + ".zone",
626
+ expected: "string",
627
+ value: input.zone
628
+ }, errorFactory)) && (null === input.free || "number" === typeof input.free || $guard(_exceptionable, {
629
+ path: _path + ".free",
630
+ expected: "(null | number)",
631
+ value: input.free
632
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size || $guard(_exceptionable, {
633
+ path: _path + ".size",
634
+ expected: "(null | number)",
635
+ value: input.size
636
+ }, errorFactory)) && (null === input.available || "number" === typeof input.available || $guard(_exceptionable, {
637
+ path: _path + ".available",
638
+ expected: "(null | number)",
639
+ value: input.available
640
+ }, errorFactory)) && (null === input.cache || "boolean" === typeof input.cache || $guard(_exceptionable, {
641
+ path: _path + ".cache",
642
+ expected: "(boolean | null)",
643
+ value: input.cache
644
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity || $guard(_exceptionable, {
645
+ path: _path + ".capacity",
646
+ expected: "(null | number)",
647
+ value: input.capacity
648
+ }, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
649
+ path: _path + ".origin",
650
+ expected: "string",
651
+ value: input.origin
652
+ }, errorFactory)) && ((Array.isArray(input.allows) || $guard(_exceptionable, {
653
+ path: _path + ".allows",
654
+ expected: "Array<\"get\" | \"put\" | \"del\">",
655
+ value: input.allows
656
+ }, errorFactory)) && input.allows.every((elem, _index1) => "get" === elem || "put" === elem || "del" === elem || $guard(_exceptionable, {
657
+ path: _path + ".allows[" + _index1 + "]",
658
+ expected: "(\"del\" | \"get\" | \"put\")",
659
+ value: elem
660
+ }, errorFactory)) || $guard(_exceptionable, {
661
+ path: _path + ".allows",
662
+ expected: "Array<\"get\" | \"put\" | \"del\">",
663
+ value: input.allows
664
+ }, errorFactory)) && (("object" === typeof input.net && null !== input.net || $guard(_exceptionable, {
665
+ path: _path + ".net",
666
+ expected: "__type",
667
+ value: input.net
668
+ }, errorFactory)) && $ao1(input.net, _path + ".net", true && _exceptionable) || $guard(_exceptionable, {
669
+ path: _path + ".net",
670
+ expected: "__type",
671
+ value: input.net
672
+ }, errorFactory)) && ("number" === typeof input.latency || $guard(_exceptionable, {
673
+ path: _path + ".latency",
674
+ expected: "number",
675
+ value: input.latency
676
+ }, errorFactory));
677
+ const $ao1 = (input, _path, _exceptionable = true) => ("number" === typeof input.rx || $guard(_exceptionable, {
678
+ path: _path + ".rx",
679
+ expected: "number",
680
+ value: input.rx
681
+ }, errorFactory)) && ("number" === typeof input.tx || $guard(_exceptionable, {
682
+ path: _path + ".tx",
683
+ expected: "number",
684
+ value: input.tx
685
+ }, errorFactory));
686
+ return ("object" === typeof input && null !== input || $guard(true, {
687
+ path: _path + "",
688
+ expected: "StorageLocationsRecordEntry",
689
+ value: input
690
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
691
+ path: _path + "",
692
+ expected: "StorageLocationsRecordEntry",
693
+ value: input
694
+ }, errorFactory);
695
+ })(input, "$input", true);
696
+ };
697
+ export const stringifyStorageLocationsRecordEntry = input => {
698
+ const $io1 = input => "number" === typeof input.rx && "number" === typeof input.tx;
699
+ const $string = __typia.json.createStringify.string;
700
+ const $throws = __typia.json.createStringify.throws;
701
+ const $so0 = input => `{"id":${$string(input.id)},"location":${$string(input.location)},"timestamp":${$string(input.timestamp)},"type":${$string(input.type)},"zone":${$string(input.zone)},"free":${null !== input.free ? input.free : "null"},"size":${null !== input.size ? input.size : "null"},"available":${null !== input.available ? input.available : "null"},"cache":${null !== input.cache ? input.cache : "null"},"capacity":${null !== input.capacity ? input.capacity : "null"},"origin":${$string(input.origin)},"allows":${`[${input.allows.map(elem => (() => {
702
+ if ("string" === typeof elem)
703
+ return $string(elem);
704
+ if ("string" === typeof elem)
705
+ return "\"" + elem + "\"";
706
+ $throws({
707
+ expected: "(\"del\" | \"get\" | \"put\")",
708
+ value: elem
709
+ });
710
+ })()).join(",")}]`},"net":${`{"rx":${input.net.rx},"tx":${input.net.tx}}`},"latency":${input.latency}}`;
711
+ return $so0(input);
712
+ };
713
+ export const assertStringifyStorageLocationsRecordEntry = (input, errorFactory) => { const assert = (input, errorFactory) => {
714
+ const __is = input => {
715
+ const $io0 = input => "string" === typeof input.id && "string" === typeof input.location && "string" === typeof input.timestamp && "string" === typeof input.type && "string" === typeof input.zone && (null === input.free || "number" === typeof input.free && !Number.isNaN(input.free)) && (null === input.size || "number" === typeof input.size && !Number.isNaN(input.size)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available)) && (null === input.cache || "boolean" === typeof input.cache) && (null === input.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity)) && "string" === typeof input.origin && (Array.isArray(input.allows) && input.allows.every(elem => "get" === elem || "put" === elem || "del" === elem)) && ("object" === typeof input.net && null !== input.net && ("number" === typeof input.net.rx && !Number.isNaN(input.net.rx) && ("number" === typeof input.net.tx && !Number.isNaN(input.net.tx)))) && ("number" === typeof input.latency && !Number.isNaN(input.latency));
716
+ return "object" === typeof input && null !== input && $io0(input);
717
+ };
718
+ if (false === __is(input))
719
+ ((input, _path, _exceptionable = true) => {
720
+ const $guard = __typia.json.createAssertStringify.guard;
721
+ const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || $guard(_exceptionable, {
722
+ path: _path + ".id",
723
+ expected: "string",
724
+ value: input.id
725
+ }, errorFactory)) && ("string" === typeof input.location || $guard(_exceptionable, {
726
+ path: _path + ".location",
727
+ expected: "string",
728
+ value: input.location
729
+ }, errorFactory)) && ("string" === typeof input.timestamp || $guard(_exceptionable, {
730
+ path: _path + ".timestamp",
731
+ expected: "string",
732
+ value: input.timestamp
733
+ }, errorFactory)) && ("string" === typeof input.type || $guard(_exceptionable, {
734
+ path: _path + ".type",
735
+ expected: "string",
736
+ value: input.type
737
+ }, errorFactory)) && ("string" === typeof input.zone || $guard(_exceptionable, {
738
+ path: _path + ".zone",
739
+ expected: "string",
740
+ value: input.zone
741
+ }, errorFactory)) && (null === input.free || "number" === typeof input.free && !Number.isNaN(input.free) || $guard(_exceptionable, {
742
+ path: _path + ".free",
743
+ expected: "(null | number)",
744
+ value: input.free
745
+ }, errorFactory)) && (null === input.size || "number" === typeof input.size && !Number.isNaN(input.size) || $guard(_exceptionable, {
746
+ path: _path + ".size",
747
+ expected: "(null | number)",
748
+ value: input.size
749
+ }, errorFactory)) && (null === input.available || "number" === typeof input.available && !Number.isNaN(input.available) || $guard(_exceptionable, {
750
+ path: _path + ".available",
751
+ expected: "(null | number)",
752
+ value: input.available
753
+ }, errorFactory)) && (null === input.cache || "boolean" === typeof input.cache || $guard(_exceptionable, {
754
+ path: _path + ".cache",
755
+ expected: "(boolean | null)",
756
+ value: input.cache
757
+ }, errorFactory)) && (null === input.capacity || "number" === typeof input.capacity && !Number.isNaN(input.capacity) || $guard(_exceptionable, {
758
+ path: _path + ".capacity",
759
+ expected: "(null | number)",
760
+ value: input.capacity
761
+ }, errorFactory)) && ("string" === typeof input.origin || $guard(_exceptionable, {
762
+ path: _path + ".origin",
763
+ expected: "string",
764
+ value: input.origin
765
+ }, errorFactory)) && ((Array.isArray(input.allows) || $guard(_exceptionable, {
766
+ path: _path + ".allows",
767
+ expected: "Array<\"get\" | \"put\" | \"del\">",
768
+ value: input.allows
769
+ }, errorFactory)) && input.allows.every((elem, _index1) => "get" === elem || "put" === elem || "del" === elem || $guard(_exceptionable, {
770
+ path: _path + ".allows[" + _index1 + "]",
771
+ expected: "(\"del\" | \"get\" | \"put\")",
772
+ value: elem
773
+ }, errorFactory)) || $guard(_exceptionable, {
774
+ path: _path + ".allows",
775
+ expected: "Array<\"get\" | \"put\" | \"del\">",
776
+ value: input.allows
777
+ }, errorFactory)) && (("object" === typeof input.net && null !== input.net || $guard(_exceptionable, {
778
+ path: _path + ".net",
779
+ expected: "__type",
780
+ value: input.net
781
+ }, errorFactory)) && $ao1(input.net, _path + ".net", true && _exceptionable) || $guard(_exceptionable, {
782
+ path: _path + ".net",
783
+ expected: "__type",
784
+ value: input.net
785
+ }, errorFactory)) && ("number" === typeof input.latency && !Number.isNaN(input.latency) || $guard(_exceptionable, {
786
+ path: _path + ".latency",
787
+ expected: "number",
788
+ value: input.latency
789
+ }, errorFactory));
790
+ const $ao1 = (input, _path, _exceptionable = true) => ("number" === typeof input.rx && !Number.isNaN(input.rx) || $guard(_exceptionable, {
791
+ path: _path + ".rx",
792
+ expected: "number",
793
+ value: input.rx
794
+ }, errorFactory)) && ("number" === typeof input.tx && !Number.isNaN(input.tx) || $guard(_exceptionable, {
795
+ path: _path + ".tx",
796
+ expected: "number",
797
+ value: input.tx
798
+ }, errorFactory));
799
+ return ("object" === typeof input && null !== input || $guard(true, {
800
+ path: _path + "",
801
+ expected: "StorageLocationsRecordEntry",
802
+ value: input
803
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
804
+ path: _path + "",
805
+ expected: "StorageLocationsRecordEntry",
806
+ value: input
807
+ }, errorFactory);
808
+ })(input, "$input", true);
809
+ return input;
810
+ }; const stringify = input => {
811
+ const $io1 = input => "number" === typeof input.rx && "number" === typeof input.tx;
812
+ const $string = __typia.json.createAssertStringify.string;
813
+ const $throws = __typia.json.createAssertStringify.throws;
814
+ const $so0 = input => `{"id":${$string(input.id)},"location":${$string(input.location)},"timestamp":${$string(input.timestamp)},"type":${$string(input.type)},"zone":${$string(input.zone)},"free":${null !== input.free ? input.free : "null"},"size":${null !== input.size ? input.size : "null"},"available":${null !== input.available ? input.available : "null"},"cache":${null !== input.cache ? input.cache : "null"},"capacity":${null !== input.capacity ? input.capacity : "null"},"origin":${$string(input.origin)},"allows":${`[${input.allows.map(elem => (() => {
815
+ if ("string" === typeof elem)
816
+ return $string(elem);
817
+ if ("string" === typeof elem)
818
+ return "\"" + elem + "\"";
819
+ $throws({
820
+ expected: "(\"del\" | \"get\" | \"put\")",
821
+ value: elem
822
+ });
823
+ })()).join(",")}]`},"net":${`{"rx":${input.net.rx},"tx":${input.net.tx}}`},"latency":${input.latency}}`;
824
+ return $so0(input);
825
+ }; return stringify(assert(input, errorFactory)); };
826
+ export const isStorageZonesRecord = input => {
827
+ const $io0 = input => Object.keys(input).every(key => {
828
+ const value = input[key];
829
+ if (undefined === value)
830
+ return true;
831
+ return "object" === typeof value && null !== value && $io1(value);
832
+ });
833
+ const $io1 = input => "number" === typeof input.priority && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem));
834
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
835
+ };
836
+ export const assertStorageZonesRecord = (input, errorFactory) => {
837
+ const __is = input => {
838
+ const $io0 = input => Object.keys(input).every(key => {
839
+ const value = input[key];
840
+ if (undefined === value)
841
+ return true;
842
+ return "object" === typeof value && null !== value && $io1(value);
843
+ });
844
+ const $io1 = input => "number" === typeof input.priority && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem));
845
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
846
+ };
847
+ if (false === __is(input))
848
+ ((input, _path, _exceptionable = true) => {
849
+ const $guard = __typia.createAssert.guard;
850
+ const $join = __typia.createAssert.join;
851
+ const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
852
+ const value = input[key];
853
+ if (undefined === value)
854
+ return true;
855
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
856
+ path: _path + $join(key),
857
+ expected: "__type",
858
+ value: value
859
+ }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
860
+ path: _path + $join(key),
861
+ expected: "__type",
862
+ value: value
863
+ }, errorFactory);
864
+ });
865
+ const $ao1 = (input, _path, _exceptionable = true) => ("number" === typeof input.priority || $guard(_exceptionable, {
866
+ path: _path + ".priority",
867
+ expected: "number",
868
+ value: input.priority
869
+ }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
870
+ path: _path + ".locations",
871
+ expected: "Array<string>",
872
+ value: input.locations
873
+ }, errorFactory)) && input.locations.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
874
+ path: _path + ".locations[" + _index1 + "]",
875
+ expected: "string",
876
+ value: elem
877
+ }, errorFactory)) || $guard(_exceptionable, {
878
+ path: _path + ".locations",
879
+ expected: "Array<string>",
880
+ value: input.locations
881
+ }, errorFactory));
882
+ return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
883
+ path: _path + "",
884
+ expected: "StorageZonesRecord",
885
+ value: input
886
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
887
+ path: _path + "",
888
+ expected: "StorageZonesRecord",
889
+ value: input
890
+ }, errorFactory);
891
+ })(input, "$input", true);
892
+ return input;
893
+ };
894
+ export const randomStorageZonesRecord = generator => {
895
+ const $generator = __typia.createRandom.generator;
896
+ const $ro0 = (_recursive = false, _depth = 0) => {
897
+ const output = {};
898
+ (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = $ro1(_recursive, _recursive ? 1 + _depth : _depth), (generator?.integer ?? $generator.integer)(0, 3));
899
+ return output;
900
+ };
901
+ const $ro1 = (_recursive = false, _depth = 0) => ({
902
+ priority: (generator?.customs ?? $generator.customs)?.number?.([]) ?? (generator?.number ?? $generator.number)(0, 100),
903
+ locations: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)())
904
+ });
905
+ return $ro0();
906
+ };
907
+ export const assertGuardStorageZonesRecord = (input, errorFactory) => {
908
+ const __is = input => {
909
+ const $io0 = input => Object.keys(input).every(key => {
910
+ const value = input[key];
911
+ if (undefined === value)
912
+ return true;
913
+ return "object" === typeof value && null !== value && $io1(value);
914
+ });
915
+ const $io1 = input => "number" === typeof input.priority && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem));
916
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
917
+ };
918
+ if (false === __is(input))
919
+ ((input, _path, _exceptionable = true) => {
920
+ const $guard = __typia.createAssertGuard.guard;
921
+ const $join = __typia.createAssertGuard.join;
922
+ const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
923
+ const value = input[key];
924
+ if (undefined === value)
925
+ return true;
926
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
927
+ path: _path + $join(key),
928
+ expected: "__type",
929
+ value: value
930
+ }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
931
+ path: _path + $join(key),
932
+ expected: "__type",
933
+ value: value
934
+ }, errorFactory);
935
+ });
936
+ const $ao1 = (input, _path, _exceptionable = true) => ("number" === typeof input.priority || $guard(_exceptionable, {
937
+ path: _path + ".priority",
938
+ expected: "number",
939
+ value: input.priority
940
+ }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
941
+ path: _path + ".locations",
942
+ expected: "Array<string>",
943
+ value: input.locations
944
+ }, errorFactory)) && input.locations.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
945
+ path: _path + ".locations[" + _index1 + "]",
946
+ expected: "string",
947
+ value: elem
948
+ }, errorFactory)) || $guard(_exceptionable, {
949
+ path: _path + ".locations",
950
+ expected: "Array<string>",
951
+ value: input.locations
952
+ }, errorFactory));
953
+ return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
954
+ path: _path + "",
955
+ expected: "StorageZonesRecord",
956
+ value: input
957
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
958
+ path: _path + "",
959
+ expected: "StorageZonesRecord",
960
+ value: input
961
+ }, errorFactory);
962
+ })(input, "$input", true);
963
+ };
964
+ export const stringifyStorageZonesRecord = input => {
965
+ const $io1 = input => "number" === typeof input.priority && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem));
966
+ const $string = __typia.json.createStringify.string;
967
+ const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
968
+ return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
969
+ const $so1 = input => `{"priority":${input.priority},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`}}`;
970
+ return $so0(input);
971
+ };
972
+ export const assertStringifyStorageZonesRecord = (input, errorFactory) => { const assert = (input, errorFactory) => {
973
+ const __is = input => {
974
+ const $io0 = input => Object.keys(input).every(key => {
975
+ const value = input[key];
976
+ if (undefined === value)
977
+ return true;
978
+ return "object" === typeof value && null !== value && $io1(value);
979
+ });
980
+ const $io1 = input => "number" === typeof input.priority && !Number.isNaN(input.priority) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem));
981
+ return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
982
+ };
983
+ if (false === __is(input))
984
+ ((input, _path, _exceptionable = true) => {
985
+ const $guard = __typia.json.createAssertStringify.guard;
986
+ const $join = __typia.json.createAssertStringify.join;
987
+ const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
988
+ const value = input[key];
989
+ if (undefined === value)
990
+ return true;
991
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
992
+ path: _path + $join(key),
993
+ expected: "__type",
994
+ value: value
995
+ }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
996
+ path: _path + $join(key),
997
+ expected: "__type",
998
+ value: value
999
+ }, errorFactory);
1000
+ });
1001
+ const $ao1 = (input, _path, _exceptionable = true) => ("number" === typeof input.priority && !Number.isNaN(input.priority) || $guard(_exceptionable, {
1002
+ path: _path + ".priority",
1003
+ expected: "number",
1004
+ value: input.priority
1005
+ }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
1006
+ path: _path + ".locations",
1007
+ expected: "Array<string>",
1008
+ value: input.locations
1009
+ }, errorFactory)) && input.locations.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
1010
+ path: _path + ".locations[" + _index1 + "]",
1011
+ expected: "string",
1012
+ value: elem
1013
+ }, errorFactory)) || $guard(_exceptionable, {
1014
+ path: _path + ".locations",
1015
+ expected: "Array<string>",
1016
+ value: input.locations
1017
+ }, errorFactory));
1018
+ return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
1019
+ path: _path + "",
1020
+ expected: "StorageZonesRecord",
1021
+ value: input
1022
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
1023
+ path: _path + "",
1024
+ expected: "StorageZonesRecord",
1025
+ value: input
1026
+ }, errorFactory);
1027
+ })(input, "$input", true);
1028
+ return input;
1029
+ }; const stringify = input => {
1030
+ const $io1 = input => "number" === typeof input.priority && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem));
1031
+ const $string = __typia.json.createAssertStringify.string;
1032
+ const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
1033
+ return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
1034
+ const $so1 = input => `{"priority":${input.priority},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`}}`;
1035
+ return $so0(input);
1036
+ }; return stringify(assert(input, errorFactory)); };