@nxtedition/types 1.6.13 → 23.0.1

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.
@@ -120,450 +120,3 @@ export const assertStringifyMessage = (input, errorFactory) => { const assert =
120
120
  const $string = __typia.json.createAssertStringify.string;
121
121
  return `{"level":${input.level},"code":${$string(input.code)},"msg":${$string(input.msg)}}`;
122
122
  }; return stringify(assert(input, errorFactory)); };
123
- export const isRpcMethods = input => {
124
- const $io0 = input => Object.keys(input).every(key => {
125
- const value = input[key];
126
- if (undefined === value)
127
- return true;
128
- return "object" === typeof value && null !== value && $io1(value);
129
- });
130
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
131
- const $io2 = input => Object.keys(input).every(key => {
132
- const value = input[key];
133
- if (undefined === value)
134
- return true;
135
- return true;
136
- });
137
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
138
- };
139
- export const assertRpcMethods = (input, errorFactory) => {
140
- const __is = input => {
141
- const $io0 = input => Object.keys(input).every(key => {
142
- const value = input[key];
143
- if (undefined === value)
144
- return true;
145
- return "object" === typeof value && null !== value && $io1(value);
146
- });
147
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
148
- const $io2 = input => Object.keys(input).every(key => {
149
- const value = input[key];
150
- if (undefined === value)
151
- return true;
152
- return true;
153
- });
154
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
155
- };
156
- if (false === __is(input))
157
- ((input, _path, _exceptionable = true) => {
158
- const $guard = __typia.createAssert.guard;
159
- const $join = __typia.createAssert.join;
160
- const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
161
- const value = input[key];
162
- if (undefined === value)
163
- return true;
164
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
165
- path: _path + $join(key),
166
- expected: "RpcMethod",
167
- value: value
168
- }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
169
- path: _path + $join(key),
170
- expected: "RpcMethod",
171
- value: value
172
- }, errorFactory);
173
- });
174
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
175
- path: _path + ".rpcId",
176
- expected: "string",
177
- value: input.rpcId
178
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
179
- path: _path + ".rpcData",
180
- expected: "Record<string, unknown>",
181
- value: input.rpcData
182
- }, errorFactory)) && $ao2(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
183
- path: _path + ".rpcData",
184
- expected: "Record<string, unknown>",
185
- value: input.rpcData
186
- }, errorFactory));
187
- const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
188
- const value = input[key];
189
- if (undefined === value)
190
- return true;
191
- return true;
192
- });
193
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
194
- path: _path + "",
195
- expected: "RpcMethods",
196
- value: input
197
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
198
- path: _path + "",
199
- expected: "RpcMethods",
200
- value: input
201
- }, errorFactory);
202
- })(input, "$input", true);
203
- return input;
204
- };
205
- export const randomRpcMethods = generator => {
206
- const $generator = __typia.createRandom.generator;
207
- const $ro0 = (_recursive = false, _depth = 0) => {
208
- const output = {};
209
- (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));
210
- return output;
211
- };
212
- const $ro1 = (_recursive = false, _depth = 0) => ({
213
- rpcId: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
214
- rpcData: $ro2(_recursive, _recursive ? 1 + _depth : _depth)
215
- });
216
- const $ro2 = (_recursive = false, _depth = 0) => {
217
- const output = {};
218
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
219
- return output;
220
- };
221
- return $ro0();
222
- };
223
- export const assertGuardRpcMethods = (input, errorFactory) => {
224
- const __is = input => {
225
- const $io0 = input => Object.keys(input).every(key => {
226
- const value = input[key];
227
- if (undefined === value)
228
- return true;
229
- return "object" === typeof value && null !== value && $io1(value);
230
- });
231
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
232
- const $io2 = input => Object.keys(input).every(key => {
233
- const value = input[key];
234
- if (undefined === value)
235
- return true;
236
- return true;
237
- });
238
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
239
- };
240
- if (false === __is(input))
241
- ((input, _path, _exceptionable = true) => {
242
- const $guard = __typia.createAssertGuard.guard;
243
- const $join = __typia.createAssertGuard.join;
244
- const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
245
- const value = input[key];
246
- if (undefined === value)
247
- return true;
248
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
249
- path: _path + $join(key),
250
- expected: "RpcMethod",
251
- value: value
252
- }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
253
- path: _path + $join(key),
254
- expected: "RpcMethod",
255
- value: value
256
- }, errorFactory);
257
- });
258
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
259
- path: _path + ".rpcId",
260
- expected: "string",
261
- value: input.rpcId
262
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
263
- path: _path + ".rpcData",
264
- expected: "Record<string, unknown>",
265
- value: input.rpcData
266
- }, errorFactory)) && $ao2(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
267
- path: _path + ".rpcData",
268
- expected: "Record<string, unknown>",
269
- value: input.rpcData
270
- }, errorFactory));
271
- const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
272
- const value = input[key];
273
- if (undefined === value)
274
- return true;
275
- return true;
276
- });
277
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
278
- path: _path + "",
279
- expected: "RpcMethods",
280
- value: input
281
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
282
- path: _path + "",
283
- expected: "RpcMethods",
284
- value: input
285
- }, errorFactory);
286
- })(input, "$input", true);
287
- };
288
- export const stringifyRpcMethods = input => {
289
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
290
- const $io2 = input => Object.keys(input).every(key => {
291
- const value = input[key];
292
- if (undefined === value)
293
- return true;
294
- return true;
295
- });
296
- const $string = __typia.json.createStringify.string;
297
- const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
298
- return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
299
- const $so1 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so2(input.rpcData)}}`;
300
- const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
301
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
302
- return $so0(input);
303
- };
304
- export const assertStringifyRpcMethods = (input, errorFactory) => { const assert = (input, errorFactory) => {
305
- const __is = input => {
306
- const $io0 = input => Object.keys(input).every(key => {
307
- const value = input[key];
308
- if (undefined === value)
309
- return true;
310
- return "object" === typeof value && null !== value && $io1(value);
311
- });
312
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
313
- const $io2 = input => Object.keys(input).every(key => {
314
- const value = input[key];
315
- if (undefined === value)
316
- return true;
317
- return true;
318
- });
319
- return "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input);
320
- };
321
- if (false === __is(input))
322
- ((input, _path, _exceptionable = true) => {
323
- const $guard = __typia.json.createAssertStringify.guard;
324
- const $join = __typia.json.createAssertStringify.join;
325
- const $ao0 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
326
- const value = input[key];
327
- if (undefined === value)
328
- return true;
329
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
330
- path: _path + $join(key),
331
- expected: "RpcMethod",
332
- value: value
333
- }, errorFactory)) && $ao1(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
334
- path: _path + $join(key),
335
- expected: "RpcMethod",
336
- value: value
337
- }, errorFactory);
338
- });
339
- const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
340
- path: _path + ".rpcId",
341
- expected: "string",
342
- value: input.rpcId
343
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
344
- path: _path + ".rpcData",
345
- expected: "Record<string, unknown>",
346
- value: input.rpcData
347
- }, errorFactory)) && $ao2(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
348
- path: _path + ".rpcData",
349
- expected: "Record<string, unknown>",
350
- value: input.rpcData
351
- }, errorFactory));
352
- const $ao2 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
353
- const value = input[key];
354
- if (undefined === value)
355
- return true;
356
- return true;
357
- });
358
- return ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
359
- path: _path + "",
360
- expected: "RpcMethods",
361
- value: input
362
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
363
- path: _path + "",
364
- expected: "RpcMethods",
365
- value: input
366
- }, errorFactory);
367
- })(input, "$input", true);
368
- return input;
369
- }; const stringify = input => {
370
- const $io1 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io2(input.rpcData));
371
- const $io2 = input => Object.keys(input).every(key => {
372
- const value = input[key];
373
- if (undefined === value)
374
- return true;
375
- return true;
376
- });
377
- const $string = __typia.json.createAssertStringify.string;
378
- const $so0 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
379
- return ""; return `${JSON.stringify(key)}:${$so1(value)}`; }).filter(str => "" !== str).join(",")}}`;
380
- const $so1 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so2(input.rpcData)}}`;
381
- const $so2 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
382
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
383
- return $so0(input);
384
- }; return stringify(assert(input, errorFactory)); };
385
- export const isRpcMethod = input => {
386
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
387
- const $io1 = input => Object.keys(input).every(key => {
388
- const value = input[key];
389
- if (undefined === value)
390
- return true;
391
- return true;
392
- });
393
- return "object" === typeof input && null !== input && $io0(input);
394
- };
395
- export const assertRpcMethod = (input, errorFactory) => {
396
- const __is = input => {
397
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
398
- const $io1 = input => Object.keys(input).every(key => {
399
- const value = input[key];
400
- if (undefined === value)
401
- return true;
402
- return true;
403
- });
404
- return "object" === typeof input && null !== input && $io0(input);
405
- };
406
- if (false === __is(input))
407
- ((input, _path, _exceptionable = true) => {
408
- const $guard = __typia.createAssert.guard;
409
- const $join = __typia.createAssert.join;
410
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
411
- path: _path + ".rpcId",
412
- expected: "string",
413
- value: input.rpcId
414
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
415
- path: _path + ".rpcData",
416
- expected: "Record<string, unknown>",
417
- value: input.rpcData
418
- }, errorFactory)) && $ao1(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
419
- path: _path + ".rpcData",
420
- expected: "Record<string, unknown>",
421
- value: input.rpcData
422
- }, errorFactory));
423
- const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
424
- const value = input[key];
425
- if (undefined === value)
426
- return true;
427
- return true;
428
- });
429
- return ("object" === typeof input && null !== input || $guard(true, {
430
- path: _path + "",
431
- expected: "RpcMethod",
432
- value: input
433
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
434
- path: _path + "",
435
- expected: "RpcMethod",
436
- value: input
437
- }, errorFactory);
438
- })(input, "$input", true);
439
- return input;
440
- };
441
- export const randomRpcMethod = generator => {
442
- const $generator = __typia.createRandom.generator;
443
- const $ro0 = (_recursive = false, _depth = 0) => ({
444
- rpcId: (generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)(),
445
- rpcData: $ro1(_recursive, _recursive ? 1 + _depth : _depth)
446
- });
447
- const $ro1 = (_recursive = false, _depth = 0) => {
448
- const output = {};
449
- (generator?.array ?? $generator.array)(() => output[(generator?.customs ?? $generator.customs)?.string?.([]) ?? (generator?.string ?? $generator.string)()] = "any type used...", (generator?.integer ?? $generator.integer)(0, 3));
450
- return output;
451
- };
452
- return $ro0();
453
- };
454
- export const assertGuardRpcMethod = (input, errorFactory) => {
455
- const __is = input => {
456
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
457
- const $io1 = input => Object.keys(input).every(key => {
458
- const value = input[key];
459
- if (undefined === value)
460
- return true;
461
- return true;
462
- });
463
- return "object" === typeof input && null !== input && $io0(input);
464
- };
465
- if (false === __is(input))
466
- ((input, _path, _exceptionable = true) => {
467
- const $guard = __typia.createAssertGuard.guard;
468
- const $join = __typia.createAssertGuard.join;
469
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
470
- path: _path + ".rpcId",
471
- expected: "string",
472
- value: input.rpcId
473
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
474
- path: _path + ".rpcData",
475
- expected: "Record<string, unknown>",
476
- value: input.rpcData
477
- }, errorFactory)) && $ao1(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
478
- path: _path + ".rpcData",
479
- expected: "Record<string, unknown>",
480
- value: input.rpcData
481
- }, errorFactory));
482
- const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
483
- const value = input[key];
484
- if (undefined === value)
485
- return true;
486
- return true;
487
- });
488
- return ("object" === typeof input && null !== input || $guard(true, {
489
- path: _path + "",
490
- expected: "RpcMethod",
491
- value: input
492
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
493
- path: _path + "",
494
- expected: "RpcMethod",
495
- value: input
496
- }, errorFactory);
497
- })(input, "$input", true);
498
- };
499
- export const stringifyRpcMethod = input => {
500
- const $io1 = input => Object.keys(input).every(key => {
501
- const value = input[key];
502
- if (undefined === value)
503
- return true;
504
- return true;
505
- });
506
- const $string = __typia.json.createStringify.string;
507
- const $so0 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so1(input.rpcData)}}`;
508
- const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
509
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
510
- return $so0(input);
511
- };
512
- export const assertStringifyRpcMethod = (input, errorFactory) => { const assert = (input, errorFactory) => {
513
- const __is = input => {
514
- const $io0 = input => "string" === typeof input.rpcId && ("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) && $io1(input.rpcData));
515
- const $io1 = input => Object.keys(input).every(key => {
516
- const value = input[key];
517
- if (undefined === value)
518
- return true;
519
- return true;
520
- });
521
- return "object" === typeof input && null !== input && $io0(input);
522
- };
523
- if (false === __is(input))
524
- ((input, _path, _exceptionable = true) => {
525
- const $guard = __typia.json.createAssertStringify.guard;
526
- const $join = __typia.json.createAssertStringify.join;
527
- const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.rpcId || $guard(_exceptionable, {
528
- path: _path + ".rpcId",
529
- expected: "string",
530
- value: input.rpcId
531
- }, errorFactory)) && (("object" === typeof input.rpcData && null !== input.rpcData && false === Array.isArray(input.rpcData) || $guard(_exceptionable, {
532
- path: _path + ".rpcData",
533
- expected: "Record<string, unknown>",
534
- value: input.rpcData
535
- }, errorFactory)) && $ao1(input.rpcData, _path + ".rpcData", true && _exceptionable) || $guard(_exceptionable, {
536
- path: _path + ".rpcData",
537
- expected: "Record<string, unknown>",
538
- value: input.rpcData
539
- }, errorFactory));
540
- const $ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
541
- const value = input[key];
542
- if (undefined === value)
543
- return true;
544
- return true;
545
- });
546
- return ("object" === typeof input && null !== input || $guard(true, {
547
- path: _path + "",
548
- expected: "RpcMethod",
549
- value: input
550
- }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
551
- path: _path + "",
552
- expected: "RpcMethod",
553
- value: input
554
- }, errorFactory);
555
- })(input, "$input", true);
556
- return input;
557
- }; const stringify = input => {
558
- const $io1 = input => Object.keys(input).every(key => {
559
- const value = input[key];
560
- if (undefined === value)
561
- return true;
562
- return true;
563
- });
564
- const $string = __typia.json.createAssertStringify.string;
565
- const $so0 = input => `{"rpcId":${$string(input.rpcId)},"rpcData":${$so1(input.rpcData)}}`;
566
- const $so1 = input => `{${Object.entries(input).map(([key, value]) => { if (undefined === value)
567
- return ""; return `${JSON.stringify(key)}:${undefined !== value ? JSON.stringify(value) : undefined}`; }).filter(str => "" !== str).join(",")}}`;
568
- return $so0(input);
569
- }; return stringify(assert(input, errorFactory)); };
@@ -2,8 +2,7 @@ import { type AssertionGuard as __AssertionGuard } from "typia";
2
2
  import { tags } from 'typia';
3
3
  export interface Lock {
4
4
  time: number & tags.ExclusiveMinimum<0>;
5
- locations: Array<string & tags.MinLength<1>>;
6
- zone: string & tags.MinLength<1>;
5
+ locations: Array<string & tags.MinLength<1>> | null;
7
6
  replicas: number & tags.ExclusiveMinimum<0>;
8
7
  }
9
8
  export declare const isLock: (input: unknown) => input is Lock;
@@ -1,11 +1,11 @@
1
1
  import __typia from "typia";
2
2
  export const isLock = input => {
3
- const $io0 = input => "number" === typeof input.time && 0 < input.time && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("string" === typeof input.zone && 1 <= input.zone.length) && ("number" === typeof input.replicas && 0 < input.replicas);
3
+ const $io0 = input => "number" === typeof input.time && 0 < input.time && (null === input.locations || Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("number" === typeof input.replicas && 0 < input.replicas);
4
4
  return "object" === typeof input && null !== input && $io0(input);
5
5
  };
6
6
  export const assertLock = (input, errorFactory) => {
7
7
  const __is = input => {
8
- const $io0 = input => "number" === typeof input.time && 0 < input.time && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("string" === typeof input.zone && 1 <= input.zone.length) && ("number" === typeof input.replicas && 0 < input.replicas);
8
+ const $io0 = input => "number" === typeof input.time && 0 < input.time && (null === input.locations || Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("number" === typeof input.replicas && 0 < input.replicas);
9
9
  return "object" === typeof input && null !== input && $io0(input);
10
10
  };
11
11
  if (false === __is(input))
@@ -19,9 +19,9 @@ export const assertLock = (input, errorFactory) => {
19
19
  path: _path + ".time",
20
20
  expected: "(number & ExclusiveMinimum<0>)",
21
21
  value: input.time
22
- }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
22
+ }, errorFactory)) && (null === input.locations || (Array.isArray(input.locations) || $guard(_exceptionable, {
23
23
  path: _path + ".locations",
24
- expected: "Array<string & MinLength<1>>",
24
+ expected: "(Array<string & MinLength<1>> | null)",
25
25
  value: input.locations
26
26
  }, errorFactory)) && input.locations.every((elem, _index1) => "string" === typeof elem && (1 <= elem.length || $guard(_exceptionable, {
27
27
  path: _path + ".locations[" + _index1 + "]",
@@ -33,16 +33,8 @@ export const assertLock = (input, errorFactory) => {
33
33
  value: elem
34
34
  }, errorFactory)) || $guard(_exceptionable, {
35
35
  path: _path + ".locations",
36
- expected: "Array<string & MinLength<1>>",
36
+ expected: "(Array<string & MinLength<1>> | null)",
37
37
  value: input.locations
38
- }, errorFactory)) && ("string" === typeof input.zone && (1 <= input.zone.length || $guard(_exceptionable, {
39
- path: _path + ".zone",
40
- expected: "string & MinLength<1>",
41
- value: input.zone
42
- }, errorFactory)) || $guard(_exceptionable, {
43
- path: _path + ".zone",
44
- expected: "(string & MinLength<1>)",
45
- value: input.zone
46
38
  }, errorFactory)) && ("number" === typeof input.replicas && (0 < input.replicas || $guard(_exceptionable, {
47
39
  path: _path + ".replicas",
48
40
  expected: "number & ExclusiveMinimum<0>",
@@ -66,6 +58,7 @@ export const assertLock = (input, errorFactory) => {
66
58
  };
67
59
  export const randomLock = generator => {
68
60
  const $generator = __typia.createRandom.generator;
61
+ const $pick = __typia.createRandom.pick;
69
62
  const $ro0 = (_recursive = false, _depth = 0) => ({
70
63
  time: (generator?.customs ?? $generator.customs)?.number?.([
71
64
  {
@@ -74,20 +67,16 @@ export const randomLock = generator => {
74
67
  value: 0
75
68
  }
76
69
  ]) ?? (generator?.number ?? $generator.number)(0, 10),
77
- locations: (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([
78
- {
79
- name: "MinLength<1>",
80
- kind: "minLength",
81
- value: 1
82
- }
83
- ]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25))),
84
- zone: (generator?.customs ?? $generator.customs)?.string?.([
85
- {
86
- name: "MinLength<1>",
87
- kind: "minLength",
88
- value: 1
89
- }
90
- ]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)),
70
+ locations: $pick([
71
+ () => null,
72
+ () => (generator?.array ?? $generator.array)(() => (generator?.customs ?? $generator.customs)?.string?.([
73
+ {
74
+ name: "MinLength<1>",
75
+ kind: "minLength",
76
+ value: 1
77
+ }
78
+ ]) ?? (generator?.string ?? $generator.string)((generator?.integer ?? $generator.integer)(1, 25)))
79
+ ])(),
91
80
  replicas: (generator?.customs ?? $generator.customs)?.number?.([
92
81
  {
93
82
  name: "ExclusiveMinimum<0>",
@@ -100,7 +89,7 @@ export const randomLock = generator => {
100
89
  };
101
90
  export const assertGuardLock = (input, errorFactory) => {
102
91
  const __is = input => {
103
- const $io0 = input => "number" === typeof input.time && 0 < input.time && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("string" === typeof input.zone && 1 <= input.zone.length) && ("number" === typeof input.replicas && 0 < input.replicas);
92
+ const $io0 = input => "number" === typeof input.time && 0 < input.time && (null === input.locations || Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("number" === typeof input.replicas && 0 < input.replicas);
104
93
  return "object" === typeof input && null !== input && $io0(input);
105
94
  };
106
95
  if (false === __is(input))
@@ -114,9 +103,9 @@ export const assertGuardLock = (input, errorFactory) => {
114
103
  path: _path + ".time",
115
104
  expected: "(number & ExclusiveMinimum<0>)",
116
105
  value: input.time
117
- }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
106
+ }, errorFactory)) && (null === input.locations || (Array.isArray(input.locations) || $guard(_exceptionable, {
118
107
  path: _path + ".locations",
119
- expected: "Array<string & MinLength<1>>",
108
+ expected: "(Array<string & MinLength<1>> | null)",
120
109
  value: input.locations
121
110
  }, errorFactory)) && input.locations.every((elem, _index1) => "string" === typeof elem && (1 <= elem.length || $guard(_exceptionable, {
122
111
  path: _path + ".locations[" + _index1 + "]",
@@ -128,16 +117,8 @@ export const assertGuardLock = (input, errorFactory) => {
128
117
  value: elem
129
118
  }, errorFactory)) || $guard(_exceptionable, {
130
119
  path: _path + ".locations",
131
- expected: "Array<string & MinLength<1>>",
120
+ expected: "(Array<string & MinLength<1>> | null)",
132
121
  value: input.locations
133
- }, errorFactory)) && ("string" === typeof input.zone && (1 <= input.zone.length || $guard(_exceptionable, {
134
- path: _path + ".zone",
135
- expected: "string & MinLength<1>",
136
- value: input.zone
137
- }, errorFactory)) || $guard(_exceptionable, {
138
- path: _path + ".zone",
139
- expected: "(string & MinLength<1>)",
140
- value: input.zone
141
122
  }, errorFactory)) && ("number" === typeof input.replicas && (0 < input.replicas || $guard(_exceptionable, {
142
123
  path: _path + ".replicas",
143
124
  expected: "number & ExclusiveMinimum<0>",
@@ -160,12 +141,12 @@ export const assertGuardLock = (input, errorFactory) => {
160
141
  };
161
142
  export const stringifyLock = input => {
162
143
  const $string = __typia.json.createStringify.string;
163
- const $so0 = input => `{"time":${input.time},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`},"zone":${$string(input.zone)},"replicas":${input.replicas}}`;
144
+ const $so0 = input => `{"time":${input.time},"locations":${null !== input.locations ? `[${input.locations.map(elem => $string(elem)).join(",")}]` : "null"},"replicas":${input.replicas}}`;
164
145
  return $so0(input);
165
146
  };
166
147
  export const assertStringifyLock = (input, errorFactory) => { const assert = (input, errorFactory) => {
167
148
  const __is = input => {
168
- const $io0 = input => "number" === typeof input.time && (!Number.isNaN(input.time) && 0 < input.time) && (Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("string" === typeof input.zone && 1 <= input.zone.length) && ("number" === typeof input.replicas && (!Number.isNaN(input.replicas) && 0 < input.replicas));
149
+ const $io0 = input => "number" === typeof input.time && (!Number.isNaN(input.time) && 0 < input.time) && (null === input.locations || Array.isArray(input.locations) && input.locations.every(elem => "string" === typeof elem && 1 <= elem.length)) && ("number" === typeof input.replicas && (!Number.isNaN(input.replicas) && 0 < input.replicas));
169
150
  return "object" === typeof input && null !== input && $io0(input);
170
151
  };
171
152
  if (false === __is(input))
@@ -183,9 +164,9 @@ export const assertStringifyLock = (input, errorFactory) => { const assert = (in
183
164
  path: _path + ".time",
184
165
  expected: "(number & ExclusiveMinimum<0>)",
185
166
  value: input.time
186
- }, errorFactory)) && ((Array.isArray(input.locations) || $guard(_exceptionable, {
167
+ }, errorFactory)) && (null === input.locations || (Array.isArray(input.locations) || $guard(_exceptionable, {
187
168
  path: _path + ".locations",
188
- expected: "Array<string & MinLength<1>>",
169
+ expected: "(Array<string & MinLength<1>> | null)",
189
170
  value: input.locations
190
171
  }, errorFactory)) && input.locations.every((elem, _index1) => "string" === typeof elem && (1 <= elem.length || $guard(_exceptionable, {
191
172
  path: _path + ".locations[" + _index1 + "]",
@@ -197,16 +178,8 @@ export const assertStringifyLock = (input, errorFactory) => { const assert = (in
197
178
  value: elem
198
179
  }, errorFactory)) || $guard(_exceptionable, {
199
180
  path: _path + ".locations",
200
- expected: "Array<string & MinLength<1>>",
181
+ expected: "(Array<string & MinLength<1>> | null)",
201
182
  value: input.locations
202
- }, errorFactory)) && ("string" === typeof input.zone && (1 <= input.zone.length || $guard(_exceptionable, {
203
- path: _path + ".zone",
204
- expected: "string & MinLength<1>",
205
- value: input.zone
206
- }, errorFactory)) || $guard(_exceptionable, {
207
- path: _path + ".zone",
208
- expected: "(string & MinLength<1>)",
209
- value: input.zone
210
183
  }, errorFactory)) && ("number" === typeof input.replicas && (!Number.isNaN(input.replicas) || $guard(_exceptionable, {
211
184
  path: _path + ".replicas",
212
185
  expected: "number",
@@ -233,6 +206,6 @@ export const assertStringifyLock = (input, errorFactory) => { const assert = (in
233
206
  return input;
234
207
  }; const stringify = input => {
235
208
  const $string = __typia.json.createAssertStringify.string;
236
- const $so0 = input => `{"time":${input.time},"locations":${`[${input.locations.map(elem => $string(elem)).join(",")}]`},"zone":${$string(input.zone)},"replicas":${input.replicas}}`;
209
+ const $so0 = input => `{"time":${input.time},"locations":${null !== input.locations ? `[${input.locations.map(elem => $string(elem)).join(",")}]` : "null"},"replicas":${input.replicas}}`;
237
210
  return $so0(input);
238
211
  }; return stringify(assert(input, errorFactory)); };