typia 5.3.12-dev.20240119 → 5.3.12-dev.20240121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/misc.ts CHANGED
@@ -1,726 +1,726 @@
1
- /* ===========================================================
2
- MISCELLAENOUS
3
- - LITERALS
4
- - CLONE
5
- - PRUNE
6
- - FACTORY FUNCTIONS
7
- ==============================================================
8
- LITERALS
9
- ----------------------------------------------------------- */
10
- import * as Namespace from "./functional/Namespace";
11
-
12
- import { Atomic } from "./typings/Atomic";
13
-
14
- import { IValidation } from "./IValidation";
15
- import { Resolved } from "./Resolved";
16
-
17
- /**
18
- * > You must configure the generic argument `T`.
19
- *
20
- * Union literal type to array.
21
- *
22
- * Converts a union literal type to an array of its members.
23
- *
24
- * ```typescript
25
- * literals<"A" | "B" | 1>; // ["A", "B", 1]
26
- * ```
27
- *
28
- * @template T Union literal type
29
- * @return Array of union literal type's members
30
- *
31
- * @author Jeongho Nam - https://github.com/samchon
32
- */
33
- export function literals(): never;
34
-
35
- /**
36
- * Union literal type to array.
37
- *
38
- * Converts a union literal type to an array of its members.
39
- *
40
- * ```typescript
41
- * literals<"A" | "B" | 1>; // ["A", "B", 1]
42
- * ```
43
- *
44
- * @template T Union literal type
45
- * @return Array of union literal type's members
46
- *
47
- * @author Jeongho Nam - https://github.com/samchon
48
- */
49
- export function literals<T extends Atomic.Type | null>(): T[];
50
-
51
- /**
52
- * @internal
53
- */
54
- export function literals(): never {
55
- halt("literals");
56
- }
57
-
58
- /* -----------------------------------------------------------
59
- CLONE
60
- ----------------------------------------------------------- */
61
- /**
62
- * Clone a data.
63
- *
64
- * Clones an instance following type `T`. If the target *input* value or its member
65
- * variable contains a class instance having methods, those methods would not be
66
- * cloned.
67
- *
68
- * For reference, this `typia.misc.clone()` function does not validate the input value
69
- * type. It just believes that the input value is following the type `T`. Therefore,
70
- * if you can't ensure the input value type, it would be better to call
71
- * {@link assertClone} function instead.
72
- *
73
- * @template T Type of the input value
74
- * @param input A value to be cloned
75
- * @return Cloned data
76
- *
77
- * @author Jeongho Nam - https://github.com/samchon
78
- */
79
- function clone<T>(input: T): Resolved<T>;
80
-
81
- /**
82
- * @internal
83
- */
84
- function clone(): never {
85
- halt("clone");
86
- }
87
- const clonePure = /** @__PURE__ */ Object.assign<typeof clone, {}>(
88
- clone,
89
- /** @__PURE__ */ Namespace.misc.clone("clone"),
90
- );
91
- export { clonePure as clone };
92
-
93
- /**
94
- * Clone a data with type assertion.
95
- *
96
- * Clones an instance following type `T`, with type assertion. If the target `input`
97
- * value or its member variable contains a class instance having methods, those
98
- * methods would not be cloned.
99
- *
100
- * In such reason, when `input` value is not matched with the type `T`, it throws an
101
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
102
- * data would be returned.
103
- *
104
- * @template T Type of the input value
105
- * @param input A value to be cloned
106
- * @return Cloned data
107
- *
108
- * @author Jeongho Nam - https://github.com/samchon
109
- */
110
- function assertClone<T>(input: T): Resolved<T>;
111
-
112
- /**
113
- * Clone a data with type assertion.
114
- *
115
- * Clones an instance following type `T`, with type assertion. If the target `input`
116
- * value or its member variable contains a class instance having methods, those
117
- * methods would not be cloned.
118
- *
119
- * In such reason, when `input` value is not matched with the type `T`, it throws an
120
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
121
- * data would be returned.
122
- *
123
- * @template T Type of the input value
124
- * @param input A value to be cloned
125
- * @return Cloned data
126
- *
127
- * @author Jeongho Nam - https://github.com/samchon
128
- */
129
- function assertClone<T>(input: unknown): Resolved<T>;
130
-
131
- /**
132
- * @internal
133
- */
134
- function assertClone(): never {
135
- halt("assertClone");
136
- }
137
- const assertClonePure = /** @__PURE__ */ Object.assign<
138
- typeof assertClone,
139
- {},
140
- {}
141
- >(
142
- assertClone,
143
- /** @__PURE__ */ Namespace.assert("misc.assertClone"),
144
- /** @__PURE__ */ Namespace.misc.clone("assertClone"),
145
- );
146
- export { assertClonePure as assertClone };
147
-
148
- /**
149
- * Clone a data with type checking.
150
- *
151
- * Clones an instance following type `T`, with type checking. If the target `input`
152
- * value or its member variable contains a class instance having methods, those
153
- * methods would not be cloned.
154
- *
155
- * In such reason, when `input` value is not matched with the type `T`, it returns
156
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
157
- * data would be returned.
158
- *
159
- * @template T Type of the input value
160
- * @param input A value to be cloned
161
- * @return Cloned data when exact type, otherwise null
162
- *
163
- * @author Jeongho Nam - https://github.com/samchon
164
- */
165
- function isClone<T>(input: T): Resolved<T> | null;
166
-
167
- /**
168
- * Clone a data with type checking.
169
- *
170
- * Clones an instance following type `T`, with type checking. If the target `input`
171
- * value or its member variable contains a class instance having methods, those
172
- * methods would not be cloned.
173
- *
174
- * In such reason, when `input` value is not matched with the type `T`, it returns
175
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
176
- * data would be returned.
177
- *
178
- * @template T Type of the input value
179
- * @param input A value to be cloned
180
- * @return Cloned data when exact type, otherwise null
181
- *
182
- * @author Jeongho Nam - https://github.com/samchon
183
- */
184
- function isClone<T>(input: unknown): Resolved<T> | null;
185
-
186
- /**
187
- * @internal
188
- */
189
- function isClone(): never {
190
- halt("isClone");
191
- }
192
- const isClonePure = /** @__PURE__ */ Object.assign<typeof isClone, {}, {}>(
193
- isClone,
194
- /** @__PURE__ */ Namespace.is(),
195
- /** @__PURE__ */ Namespace.misc.clone("isClone"),
196
- );
197
- export { isClonePure as isClone };
198
-
199
- /**
200
- * Clone a data with detailed type validation.
201
- *
202
- * Clones an instance following type `T`, with detailed type validation. If the target
203
- * `input` value or its member variable contains a class instance having methods,
204
- * those methods would not be cloned.
205
- *
206
- * In such reason, when `input` value is not matched with the type `T`, it returns
207
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
208
- * value, cloned data would be stored in `data` property of the output
209
- * {@link IValidation.Success} instance.
210
- *
211
- * @template T Type of the input value
212
- * @param input A value to be cloned
213
- * @returns Validation result with cloned value
214
- */
215
- function validateClone<T>(input: T): IValidation<Resolved<T>>;
216
-
217
- /**
218
- * Clone a data with detailed type validation.
219
- *
220
- * Clones an instance following type `T`, with detailed type validation. If the target
221
- * `input` value or its member variable contains a class instance having methods,
222
- * those methods would not be cloned.
223
- *
224
- * In such reason, when `input` value is not matched with the type `T`, it returns
225
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
226
- * value, cloned data would be stored in `data` property of the output
227
- * {@link IValidation.Success} instance.
228
- *
229
- * @template T Type of the input value
230
- * @param input A value to be cloned
231
- * @returns Validation result with cloned value
232
- */
233
- function validateClone<T>(input: unknown): IValidation<Resolved<T>>;
234
-
235
- /**
236
- * @internal
237
- */
238
- function validateClone(): never {
239
- halt("validateClone");
240
- }
241
- const validateClonePure = /** @__PURE__ */ Object.assign<
242
- typeof validateClone,
243
- {},
244
- {}
245
- >(
246
- validateClone,
247
- /** @__PURE__ */ Namespace.validate(),
248
- /** @__PURE__ */ Namespace.misc.clone("validateClone"),
249
- );
250
- export { validateClonePure as validateClone };
251
-
252
- /* -----------------------------------------------------------
253
- PRUNE
254
- ----------------------------------------------------------- */
255
- /**
256
- * Prune, erase superfluous properties.
257
- *
258
- * Remove every superfluous properties from the `input` object, even including nested
259
- * objects. Note that, as every superfluous properties would be deleted, you never can
260
- * read those superfluous properties after calling this `prune()` function.
261
- *
262
- * For reference, this `typia.misc.prune()` function does not validate the input value
263
- * type. It just believes that the input value is following the type `T`. Therefore,
264
- * if you can't ensure the input value type, it would better to call one of below
265
- * functions instead.
266
- *
267
- * - {@link assertPrune}
268
- * - {@link isPrune}
269
- * - {@link validatePrune}
270
- *
271
- * @template T Type of the input value
272
- * @param input Target instance to prune
273
- *
274
- * @author Jeongho Nam - https://github.com/samchon
275
- */
276
- function prune<T extends object>(input: T): void;
277
-
278
- /**
279
- * @internal
280
- */
281
- function prune(): never {
282
- halt("prune");
283
- }
284
- const prunePure = /** @__PURE__ */ Object.assign<typeof prune, {}>(
285
- prune,
286
- /** @__PURE__ */ Namespace.misc.prune("prune"),
287
- );
288
- export { prunePure as prune };
289
-
290
- /**
291
- * Prune, erase superfluous properties, with type assertion.
292
- *
293
- * `typia.misc.assertPrune()` is a combination function of {@link assert} and
294
- * {@link prune}. Therefore, it removes every superfluous properties from the `input`
295
- * object including nested objects, with type assertion.
296
- *
297
- * In such reason, when `input` value is not matched with the type `T`, it throws an
298
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
299
- * every superfluous properties would be removed, including nested objects.
300
- *
301
- * @template T Type of the input value
302
- * @param input Target instance to assert and prune
303
- *
304
- * @author Jeongho Nam - https://github.com/samchon
305
- */
306
- function assertPrune<T>(input: T): T;
307
-
308
- /**
309
- * Prune, erase superfluous properties, with type assertion.
310
- *
311
- * `typia.misc.assertPrune()` is a combination function of {@link assert} and
312
- * {@link prune}. Therefore, it removes every superfluous properties from the `input`
313
- * object including nested objects, with type assertion.
314
- *
315
- * In such reason, when `input` value is not matched with the type `T`, it throws an
316
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
317
- * every superfluous properties would be removed, including nested objects.
318
- *
319
- * @template T Type of the input value
320
- * @param input Target instance to assert and prune
321
- *
322
- * @author Jeongho Nam - https://github.com/samchon
323
- */
324
- function assertPrune<T>(input: unknown): T;
325
-
326
- /**
327
- * @internal
328
- */
329
- function assertPrune(): unknown {
330
- halt("assertPrune");
331
- }
332
- const assertPrunePure = /** @__PURE__ */ Object.assign<
333
- typeof assertPrune,
334
- {},
335
- {}
336
- >(
337
- assertPrune,
338
- /** @__PURE__ */ Namespace.assert("misc.assertPrune"),
339
- /** @__PURE__ */ Namespace.misc.prune("assertPrune"),
340
- );
341
- export { assertPrunePure as assertPrune };
342
-
343
- /**
344
- * Prune, erase superfluous properties, with type checking.
345
- *
346
- * `typia.misc.assertPrune()` is a combination function of {@link is} and
347
- * {@link prune}. Therefore, it removes every superfluous properties from the `input`
348
- * object including nested objects, with type checking.
349
- *
350
- * In such reason, when `input` value is not matched with the type `T`, it returns
351
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
352
- * `true` after removing every superfluous properties, including nested objects.
353
- *
354
- * @template T Type of the input value
355
- * @param input Target instance to check and prune
356
- * @returns Whether the parametric value is following the type `T` or not
357
- *
358
- * @author Jeongho Nam - https://github.com/samchon
359
- */
360
- function isPrune<T>(input: T): input is T;
361
-
362
- /**
363
- * Prune, erase superfluous properties, with type checking.
364
- *
365
- * `typia.misc.assertPrune()` is a combination function of {@link is} and
366
- * {@link prune}. Therefore, it removes every superfluous properties from the `input`
367
- * object including nested objects, with type checking.
368
- *
369
- * In such reason, when `input` value is not matched with the type `T`, it returns
370
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
371
- * `true` after removing every superfluous properties, including nested objects.
372
- *
373
- * @template T Type of the input value
374
- * @param input Target instance to check and prune
375
- * @returns Whether the parametric value is following the type `T` or not
376
- *
377
- * @author Jeongho Nam - https://github.com/samchon
378
- */
379
- function isPrune<T>(input: unknown): input is T;
380
-
381
- /**
382
- * @internal
383
- */
384
- function isPrune(): never {
385
- halt("isPrune");
386
- }
387
- const isPrunePure = /** @__PURE__ */ Object.assign<typeof isPrune, {}, {}>(
388
- isPrune,
389
- /** @__PURE__ */ Namespace.is(),
390
- /** @__PURE__ */ Namespace.misc.prune("isPrune"),
391
- );
392
- export { isPrunePure as isPrune };
393
-
394
- /**
395
- * Prune, erase superfluous properties, with type validation.
396
- *
397
- * `typia.misc.validatePrune()` is a combination function of {@link validate} and
398
- * {@link prune}. Therefore, it removes every superfluous properties from the `input`
399
- * object including nested objects, with type validation.
400
- *
401
- * In such reason, when `input` value is not matched with the type `T`, it returns
402
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
403
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
404
- * removing every superfluous properties, including nested objects.
405
- *
406
- * @template T Type of the input value
407
- * @param input Target instance to validate and prune
408
- * @returns Validation result
409
- *
410
- * @author Jeongho Nam - https://github.com/samchon
411
- */
412
- function validatePrune<T>(input: T): IValidation<T>;
413
-
414
- /**
415
- * Prune, erase superfluous properties, with type validation.
416
- *
417
- * `typia.misc.validatePrune()` is a combination function of {@link validate} and
418
- * {@link prune}. Therefore, it removes every superfluous properties from the `input`
419
- * object including nested objects, with type validation.
420
- *
421
- * In such reason, when `input` value is not matched with the type `T`, it returns
422
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
423
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
424
- * removing every superfluous properties, including nested objects.
425
- *
426
- * @template T Type of the input value
427
- * @param input Target instance to validate and prune
428
- * @returns Validation result
429
- *
430
- * @author Jeongho Nam - https://github.com/samchon
431
- */
432
- function validatePrune<T>(input: unknown): IValidation<T>;
433
-
434
- /**
435
- * @internal
436
- */
437
- function validatePrune<T>(): IValidation<T> {
438
- halt("validatePrune");
439
- }
440
-
441
- const validatePrunePure = /** @__PURE__ */ Object.assign<
442
- typeof validatePrune,
443
- {},
444
- {}
445
- >(
446
- validatePrune,
447
- /** @__PURE__ */ Namespace.misc.prune("validatePrune"),
448
- /** @__PURE__ */ Namespace.validate(),
449
- );
450
- export { validatePrunePure as validatePrune };
451
-
452
- /* -----------------------------------------------------------
453
- FACTORY FUNCTIONS
454
- ----------------------------------------------------------- */
455
- /**
456
- * Creates a reusable {@link clone} function.
457
- *
458
- * @danger You must configure the generic argument `T`
459
- * @returns Nothing until you configure the generic argument `T`
460
- * @throws compile error
461
- *
462
- * @author Jeongho Nam - https://github.com/samchon
463
- */
464
- function createClone(): never;
465
-
466
- /**
467
- * Creates a resuable {@link clone} function.
468
- *
469
- * @template T Type of the input value
470
- * @returns A reusable `clone` function
471
- *
472
- * @author Jeongho Nam - https://github.com/samchon
473
- */
474
- function createClone<T>(): (input: T) => Resolved<T>;
475
-
476
- /**
477
- * @internal
478
- */
479
- function createClone(): never {
480
- halt("createClone");
481
- }
482
- const createClonePure = /** @__PURE__ */ Object.assign<typeof createClone, {}>(
483
- createClone,
484
- clone,
485
- );
486
- export { createClonePure as createClone };
487
-
488
- /**
489
- * Creates a reusable {@link assertClone} function.
490
- *
491
- * @danger You must configure the generic argument `T`
492
- * @returns Nothing until you configure the generic argument `T`
493
- * @throws compile error
494
- *
495
- * @author Jeongho Nam - https://github.com/samchon
496
- */
497
- function createAssertClone(): never;
498
-
499
- /**
500
- * Creates a resuable {@link assertClone} function.
501
- *
502
- * @template T Type of the input value
503
- * @returns A reusable `clone` function
504
- *
505
- * @author Jeongho Nam - https://github.com/samchon
506
- */
507
- function createAssertClone<T>(): (input: unknown) => Resolved<T>;
508
-
509
- /**
510
- * @internal
511
- */
512
- function createAssertClone(): never {
513
- halt("createAssertClone");
514
- }
515
- const createAssertClonePure = /** @__PURE__ */ Object.assign<
516
- typeof createAssertClone,
517
- {}
518
- >(createAssertClone, assertClone);
519
- export { createAssertClonePure as createAssertClone };
520
-
521
- /**
522
- * Creates a reusable {@link isClone} function.
523
- *
524
- * @danger You must configure the generic argument `T`
525
- * @returns Nothing until you configure the generic argument `T`
526
- * @throws compile error
527
- *
528
- * @author Jeongho Nam - https://github.com/samchon
529
- */
530
- function createIsClone(): never;
531
-
532
- /**
533
- * Creates a resuable {@link isClone} function.
534
- *
535
- * @template T Type of the input value
536
- * @returns A reusable `clone` function
537
- *
538
- * @author Jeongho Nam - https://github.com/samchon
539
- */
540
- function createIsClone<T>(): (input: unknown) => Resolved<T> | null;
541
-
542
- /**
543
- * @internal
544
- */
545
- function createIsClone(): never {
546
- halt("createIsClone");
547
- }
548
- const createIsClonePure = /** @__PURE__ */ Object.assign<
549
- typeof createIsClone,
550
- {}
551
- >(createIsClone, isClone);
552
- export { createIsClonePure as createIsClone };
553
-
554
- /**
555
- * Creates a reusable {@link validateClone} function.
556
- *
557
- * @danger You must configure the generic argument `T`
558
- * @returns Nothing until you configure the generic argument `T`
559
- * @throws compile error
560
- *
561
- * @author Jeongho Nam - https://github.com/samchon
562
- */
563
- function createValidateClone(): never;
564
-
565
- /**
566
- * Creates a resuable {@link validateClone} function.
567
- *
568
- * @template T Type of the input value
569
- * @returns A reusable `clone` function
570
- *
571
- * @author Jeongho Nam - https://github.com/samchon
572
- */
573
- function createValidateClone<T>(): (input: unknown) => IValidation<Resolved<T>>;
574
-
575
- /**
576
- * @internal
577
- */
578
- function createValidateClone(): never {
579
- halt("createValidateClone");
580
- }
581
- const createValidateClonePure = /** @__PURE__ */ Object.assign<
582
- typeof createValidateClone,
583
- {}
584
- >(createValidateClone, validateClone);
585
- export { createValidateClonePure as createValidateClone };
586
-
587
- /**
588
- * Creates a reusable {@link prune} function.
589
- *
590
- * @danger You must configure the generic argument `T`
591
- * @returns Nothing until you configure the generic argument `T`
592
- * @throws compile error
593
- *
594
- * @author Jeongho Nam - https://github.com/samchon
595
- */
596
- function createPrune(): never;
597
-
598
- /**
599
- * Creates a resuable {@link prune} function.
600
- *
601
- * @template T Type of the input value
602
- * @returns A reusable `prune` function
603
- *
604
- * @author Jeongho Nam - https://github.com/samchon
605
- */
606
- function createPrune<T extends object>(): (input: T) => void;
607
-
608
- /**
609
- * @internal
610
- */
611
- function createPrune<T extends object>(): (input: T) => void {
612
- halt("createPrune");
613
- }
614
- const createPrunePure = /** @__PURE__ */ Object.assign<typeof createPrune, {}>(
615
- createPrune,
616
- prune,
617
- );
618
- export { createPrunePure as createPrune };
619
-
620
- /**
621
- * Creates a reusable {@link assertPrune} function.
622
- *
623
- * @danger You must configure the generic argument `T`
624
- * @returns Nothing until you configure the generic argument `T`
625
- * @throws compile error
626
- *
627
- * @author Jeongho Nam - https://github.com/samchon
628
- */
629
- function createAssertPrune(): never;
630
-
631
- /**
632
- * Creates a resuable {@link assertPrune} function.
633
- *
634
- * @template T Type of the input value
635
- * @returns A reusable `isPrune` function
636
- *
637
- * @author Jeongho Nam - https://github.com/samchon
638
- */
639
- function createAssertPrune<T extends object>(): (input: T) => T;
640
-
641
- /**
642
- * @internal
643
- */
644
- function createAssertPrune<T extends object>(): (input: T) => T {
645
- halt("createAssertPrune");
646
- }
647
- const createAssertPrunePure = /** @__PURE__ */ Object.assign<
648
- typeof createAssertPrune,
649
- {}
650
- >(createAssertPrune, assertPrune);
651
- export { createAssertPrunePure as createAssertPrune };
652
-
653
- /**
654
- * Creates a reusable {@link isPrune} function.
655
- *
656
- * @danger You must configure the generic argument `T`
657
- * @returns Nothing until you configure the generic argument `T`
658
- * @throws compile error
659
- *
660
- * @author Jeongho Nam - https://github.com/samchon
661
- */
662
- function createIsPrune(): never;
663
-
664
- /**
665
- * Creates a resuable {@link isPrune} function.
666
- *
667
- * @template T Type of the input value
668
- * @returns A reusable `isPrune` function
669
- *
670
- * @author Jeongho Nam - https://github.com/samchon
671
- */
672
- function createIsPrune<T extends object>(): (input: T) => input is T;
673
-
674
- /**
675
- * @internal
676
- */
677
- function createIsPrune<T extends object>(): (input: T) => input is T {
678
- halt("createIsPrune");
679
- }
680
- const createIsPrunePure = /** @__PURE__ */ Object.assign<
681
- typeof createIsPrune,
682
- {}
683
- >(createIsPrune, isPrune);
684
- export { createIsPrunePure as createIsPrune };
685
-
686
- /**
687
- * Creates a reusable {@link validatePrune} function.
688
- *
689
- * @danger You must configure the generic argument `T`
690
- * @returns Nothing until you configure the generic argument `T`
691
- * @throws compile error
692
- *
693
- * @author Jeongho Nam - https://github.com/samchon
694
- */
695
- function createValidatePrune(): never;
696
-
697
- /**
698
- * Creates a resuable {@link validatePrune} function.
699
- *
700
- * @template T Type of the input value
701
- * @returns A reusable `validatePrune` function
702
- *
703
- * @author Jeongho Nam - https://github.com/samchon
704
- */
705
- function createValidatePrune<T extends object>(): (input: T) => IValidation<T>;
706
-
707
- /**
708
- * @internal
709
- */
710
- function createValidatePrune<T extends object>(): (input: T) => IValidation<T> {
711
- halt("createValidatePrune");
712
- }
713
- const createValidatePrunePure = /** @__PURE__ */ Object.assign<
714
- typeof createValidatePrune,
715
- {}
716
- >(createValidatePrune, validatePrune);
717
- export { createValidatePrunePure as createValidatePrune };
718
-
719
- /**
720
- * @internal
721
- */
722
- function halt(name: string): never {
723
- throw new Error(
724
- `Error on typia.misc.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
725
- );
726
- }
1
+ /* ===========================================================
2
+ MISCELLAENOUS
3
+ - LITERALS
4
+ - CLONE
5
+ - PRUNE
6
+ - FACTORY FUNCTIONS
7
+ ==============================================================
8
+ LITERALS
9
+ ----------------------------------------------------------- */
10
+ import * as Namespace from "./functional/Namespace";
11
+
12
+ import { Atomic } from "./typings/Atomic";
13
+
14
+ import { IValidation } from "./IValidation";
15
+ import { Resolved } from "./Resolved";
16
+
17
+ /**
18
+ * > You must configure the generic argument `T`.
19
+ *
20
+ * Union literal type to array.
21
+ *
22
+ * Converts a union literal type to an array of its members.
23
+ *
24
+ * ```typescript
25
+ * literals<"A" | "B" | 1>; // ["A", "B", 1]
26
+ * ```
27
+ *
28
+ * @template T Union literal type
29
+ * @return Array of union literal type's members
30
+ *
31
+ * @author Jeongho Nam - https://github.com/samchon
32
+ */
33
+ export function literals(): never;
34
+
35
+ /**
36
+ * Union literal type to array.
37
+ *
38
+ * Converts a union literal type to an array of its members.
39
+ *
40
+ * ```typescript
41
+ * literals<"A" | "B" | 1>; // ["A", "B", 1]
42
+ * ```
43
+ *
44
+ * @template T Union literal type
45
+ * @return Array of union literal type's members
46
+ *
47
+ * @author Jeongho Nam - https://github.com/samchon
48
+ */
49
+ export function literals<T extends Atomic.Type | null>(): T[];
50
+
51
+ /**
52
+ * @internal
53
+ */
54
+ export function literals(): never {
55
+ halt("literals");
56
+ }
57
+
58
+ /* -----------------------------------------------------------
59
+ CLONE
60
+ ----------------------------------------------------------- */
61
+ /**
62
+ * Clone a data.
63
+ *
64
+ * Clones an instance following type `T`. If the target *input* value or its member
65
+ * variable contains a class instance having methods, those methods would not be
66
+ * cloned.
67
+ *
68
+ * For reference, this `typia.misc.clone()` function does not validate the input value
69
+ * type. It just believes that the input value is following the type `T`. Therefore,
70
+ * if you can't ensure the input value type, it would be better to call
71
+ * {@link assertClone} function instead.
72
+ *
73
+ * @template T Type of the input value
74
+ * @param input A value to be cloned
75
+ * @return Cloned data
76
+ *
77
+ * @author Jeongho Nam - https://github.com/samchon
78
+ */
79
+ function clone<T>(input: T): Resolved<T>;
80
+
81
+ /**
82
+ * @internal
83
+ */
84
+ function clone(): never {
85
+ halt("clone");
86
+ }
87
+ const clonePure = /** @__PURE__ */ Object.assign<typeof clone, {}>(
88
+ clone,
89
+ /** @__PURE__ */ Namespace.misc.clone("clone"),
90
+ );
91
+ export { clonePure as clone };
92
+
93
+ /**
94
+ * Clone a data with type assertion.
95
+ *
96
+ * Clones an instance following type `T`, with type assertion. If the target `input`
97
+ * value or its member variable contains a class instance having methods, those
98
+ * methods would not be cloned.
99
+ *
100
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
101
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
102
+ * data would be returned.
103
+ *
104
+ * @template T Type of the input value
105
+ * @param input A value to be cloned
106
+ * @return Cloned data
107
+ *
108
+ * @author Jeongho Nam - https://github.com/samchon
109
+ */
110
+ function assertClone<T>(input: T): Resolved<T>;
111
+
112
+ /**
113
+ * Clone a data with type assertion.
114
+ *
115
+ * Clones an instance following type `T`, with type assertion. If the target `input`
116
+ * value or its member variable contains a class instance having methods, those
117
+ * methods would not be cloned.
118
+ *
119
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
120
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
121
+ * data would be returned.
122
+ *
123
+ * @template T Type of the input value
124
+ * @param input A value to be cloned
125
+ * @return Cloned data
126
+ *
127
+ * @author Jeongho Nam - https://github.com/samchon
128
+ */
129
+ function assertClone<T>(input: unknown): Resolved<T>;
130
+
131
+ /**
132
+ * @internal
133
+ */
134
+ function assertClone(): never {
135
+ halt("assertClone");
136
+ }
137
+ const assertClonePure = /** @__PURE__ */ Object.assign<
138
+ typeof assertClone,
139
+ {},
140
+ {}
141
+ >(
142
+ assertClone,
143
+ /** @__PURE__ */ Namespace.assert("misc.assertClone"),
144
+ /** @__PURE__ */ Namespace.misc.clone("assertClone"),
145
+ );
146
+ export { assertClonePure as assertClone };
147
+
148
+ /**
149
+ * Clone a data with type checking.
150
+ *
151
+ * Clones an instance following type `T`, with type checking. If the target `input`
152
+ * value or its member variable contains a class instance having methods, those
153
+ * methods would not be cloned.
154
+ *
155
+ * In such reason, when `input` value is not matched with the type `T`, it returns
156
+ * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
157
+ * data would be returned.
158
+ *
159
+ * @template T Type of the input value
160
+ * @param input A value to be cloned
161
+ * @return Cloned data when exact type, otherwise null
162
+ *
163
+ * @author Jeongho Nam - https://github.com/samchon
164
+ */
165
+ function isClone<T>(input: T): Resolved<T> | null;
166
+
167
+ /**
168
+ * Clone a data with type checking.
169
+ *
170
+ * Clones an instance following type `T`, with type checking. If the target `input`
171
+ * value or its member variable contains a class instance having methods, those
172
+ * methods would not be cloned.
173
+ *
174
+ * In such reason, when `input` value is not matched with the type `T`, it returns
175
+ * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
176
+ * data would be returned.
177
+ *
178
+ * @template T Type of the input value
179
+ * @param input A value to be cloned
180
+ * @return Cloned data when exact type, otherwise null
181
+ *
182
+ * @author Jeongho Nam - https://github.com/samchon
183
+ */
184
+ function isClone<T>(input: unknown): Resolved<T> | null;
185
+
186
+ /**
187
+ * @internal
188
+ */
189
+ function isClone(): never {
190
+ halt("isClone");
191
+ }
192
+ const isClonePure = /** @__PURE__ */ Object.assign<typeof isClone, {}, {}>(
193
+ isClone,
194
+ /** @__PURE__ */ Namespace.is(),
195
+ /** @__PURE__ */ Namespace.misc.clone("isClone"),
196
+ );
197
+ export { isClonePure as isClone };
198
+
199
+ /**
200
+ * Clone a data with detailed type validation.
201
+ *
202
+ * Clones an instance following type `T`, with detailed type validation. If the target
203
+ * `input` value or its member variable contains a class instance having methods,
204
+ * those methods would not be cloned.
205
+ *
206
+ * In such reason, when `input` value is not matched with the type `T`, it returns
207
+ * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
208
+ * value, cloned data would be stored in `data` property of the output
209
+ * {@link IValidation.Success} instance.
210
+ *
211
+ * @template T Type of the input value
212
+ * @param input A value to be cloned
213
+ * @returns Validation result with cloned value
214
+ */
215
+ function validateClone<T>(input: T): IValidation<Resolved<T>>;
216
+
217
+ /**
218
+ * Clone a data with detailed type validation.
219
+ *
220
+ * Clones an instance following type `T`, with detailed type validation. If the target
221
+ * `input` value or its member variable contains a class instance having methods,
222
+ * those methods would not be cloned.
223
+ *
224
+ * In such reason, when `input` value is not matched with the type `T`, it returns
225
+ * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
226
+ * value, cloned data would be stored in `data` property of the output
227
+ * {@link IValidation.Success} instance.
228
+ *
229
+ * @template T Type of the input value
230
+ * @param input A value to be cloned
231
+ * @returns Validation result with cloned value
232
+ */
233
+ function validateClone<T>(input: unknown): IValidation<Resolved<T>>;
234
+
235
+ /**
236
+ * @internal
237
+ */
238
+ function validateClone(): never {
239
+ halt("validateClone");
240
+ }
241
+ const validateClonePure = /** @__PURE__ */ Object.assign<
242
+ typeof validateClone,
243
+ {},
244
+ {}
245
+ >(
246
+ validateClone,
247
+ /** @__PURE__ */ Namespace.validate(),
248
+ /** @__PURE__ */ Namespace.misc.clone("validateClone"),
249
+ );
250
+ export { validateClonePure as validateClone };
251
+
252
+ /* -----------------------------------------------------------
253
+ PRUNE
254
+ ----------------------------------------------------------- */
255
+ /**
256
+ * Prune, erase superfluous properties.
257
+ *
258
+ * Remove every superfluous properties from the `input` object, even including nested
259
+ * objects. Note that, as every superfluous properties would be deleted, you never can
260
+ * read those superfluous properties after calling this `prune()` function.
261
+ *
262
+ * For reference, this `typia.misc.prune()` function does not validate the input value
263
+ * type. It just believes that the input value is following the type `T`. Therefore,
264
+ * if you can't ensure the input value type, it would better to call one of below
265
+ * functions instead.
266
+ *
267
+ * - {@link assertPrune}
268
+ * - {@link isPrune}
269
+ * - {@link validatePrune}
270
+ *
271
+ * @template T Type of the input value
272
+ * @param input Target instance to prune
273
+ *
274
+ * @author Jeongho Nam - https://github.com/samchon
275
+ */
276
+ function prune<T extends object>(input: T): void;
277
+
278
+ /**
279
+ * @internal
280
+ */
281
+ function prune(): never {
282
+ halt("prune");
283
+ }
284
+ const prunePure = /** @__PURE__ */ Object.assign<typeof prune, {}>(
285
+ prune,
286
+ /** @__PURE__ */ Namespace.misc.prune("prune"),
287
+ );
288
+ export { prunePure as prune };
289
+
290
+ /**
291
+ * Prune, erase superfluous properties, with type assertion.
292
+ *
293
+ * `typia.misc.assertPrune()` is a combination function of {@link assert} and
294
+ * {@link prune}. Therefore, it removes every superfluous properties from the `input`
295
+ * object including nested objects, with type assertion.
296
+ *
297
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
298
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
299
+ * every superfluous properties would be removed, including nested objects.
300
+ *
301
+ * @template T Type of the input value
302
+ * @param input Target instance to assert and prune
303
+ *
304
+ * @author Jeongho Nam - https://github.com/samchon
305
+ */
306
+ function assertPrune<T>(input: T): T;
307
+
308
+ /**
309
+ * Prune, erase superfluous properties, with type assertion.
310
+ *
311
+ * `typia.misc.assertPrune()` is a combination function of {@link assert} and
312
+ * {@link prune}. Therefore, it removes every superfluous properties from the `input`
313
+ * object including nested objects, with type assertion.
314
+ *
315
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
316
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
317
+ * every superfluous properties would be removed, including nested objects.
318
+ *
319
+ * @template T Type of the input value
320
+ * @param input Target instance to assert and prune
321
+ *
322
+ * @author Jeongho Nam - https://github.com/samchon
323
+ */
324
+ function assertPrune<T>(input: unknown): T;
325
+
326
+ /**
327
+ * @internal
328
+ */
329
+ function assertPrune(): unknown {
330
+ halt("assertPrune");
331
+ }
332
+ const assertPrunePure = /** @__PURE__ */ Object.assign<
333
+ typeof assertPrune,
334
+ {},
335
+ {}
336
+ >(
337
+ assertPrune,
338
+ /** @__PURE__ */ Namespace.assert("misc.assertPrune"),
339
+ /** @__PURE__ */ Namespace.misc.prune("assertPrune"),
340
+ );
341
+ export { assertPrunePure as assertPrune };
342
+
343
+ /**
344
+ * Prune, erase superfluous properties, with type checking.
345
+ *
346
+ * `typia.misc.assertPrune()` is a combination function of {@link is} and
347
+ * {@link prune}. Therefore, it removes every superfluous properties from the `input`
348
+ * object including nested objects, with type checking.
349
+ *
350
+ * In such reason, when `input` value is not matched with the type `T`, it returns
351
+ * `false` value. Otherwise, there's no problem on the `input` value, it returns
352
+ * `true` after removing every superfluous properties, including nested objects.
353
+ *
354
+ * @template T Type of the input value
355
+ * @param input Target instance to check and prune
356
+ * @returns Whether the parametric value is following the type `T` or not
357
+ *
358
+ * @author Jeongho Nam - https://github.com/samchon
359
+ */
360
+ function isPrune<T>(input: T): input is T;
361
+
362
+ /**
363
+ * Prune, erase superfluous properties, with type checking.
364
+ *
365
+ * `typia.misc.assertPrune()` is a combination function of {@link is} and
366
+ * {@link prune}. Therefore, it removes every superfluous properties from the `input`
367
+ * object including nested objects, with type checking.
368
+ *
369
+ * In such reason, when `input` value is not matched with the type `T`, it returns
370
+ * `false` value. Otherwise, there's no problem on the `input` value, it returns
371
+ * `true` after removing every superfluous properties, including nested objects.
372
+ *
373
+ * @template T Type of the input value
374
+ * @param input Target instance to check and prune
375
+ * @returns Whether the parametric value is following the type `T` or not
376
+ *
377
+ * @author Jeongho Nam - https://github.com/samchon
378
+ */
379
+ function isPrune<T>(input: unknown): input is T;
380
+
381
+ /**
382
+ * @internal
383
+ */
384
+ function isPrune(): never {
385
+ halt("isPrune");
386
+ }
387
+ const isPrunePure = /** @__PURE__ */ Object.assign<typeof isPrune, {}, {}>(
388
+ isPrune,
389
+ /** @__PURE__ */ Namespace.is(),
390
+ /** @__PURE__ */ Namespace.misc.prune("isPrune"),
391
+ );
392
+ export { isPrunePure as isPrune };
393
+
394
+ /**
395
+ * Prune, erase superfluous properties, with type validation.
396
+ *
397
+ * `typia.misc.validatePrune()` is a combination function of {@link validate} and
398
+ * {@link prune}. Therefore, it removes every superfluous properties from the `input`
399
+ * object including nested objects, with type validation.
400
+ *
401
+ * In such reason, when `input` value is not matched with the type `T`, it returns
402
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
403
+ * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
404
+ * removing every superfluous properties, including nested objects.
405
+ *
406
+ * @template T Type of the input value
407
+ * @param input Target instance to validate and prune
408
+ * @returns Validation result
409
+ *
410
+ * @author Jeongho Nam - https://github.com/samchon
411
+ */
412
+ function validatePrune<T>(input: T): IValidation<T>;
413
+
414
+ /**
415
+ * Prune, erase superfluous properties, with type validation.
416
+ *
417
+ * `typia.misc.validatePrune()` is a combination function of {@link validate} and
418
+ * {@link prune}. Therefore, it removes every superfluous properties from the `input`
419
+ * object including nested objects, with type validation.
420
+ *
421
+ * In such reason, when `input` value is not matched with the type `T`, it returns
422
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
423
+ * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
424
+ * removing every superfluous properties, including nested objects.
425
+ *
426
+ * @template T Type of the input value
427
+ * @param input Target instance to validate and prune
428
+ * @returns Validation result
429
+ *
430
+ * @author Jeongho Nam - https://github.com/samchon
431
+ */
432
+ function validatePrune<T>(input: unknown): IValidation<T>;
433
+
434
+ /**
435
+ * @internal
436
+ */
437
+ function validatePrune<T>(): IValidation<T> {
438
+ halt("validatePrune");
439
+ }
440
+
441
+ const validatePrunePure = /** @__PURE__ */ Object.assign<
442
+ typeof validatePrune,
443
+ {},
444
+ {}
445
+ >(
446
+ validatePrune,
447
+ /** @__PURE__ */ Namespace.misc.prune("validatePrune"),
448
+ /** @__PURE__ */ Namespace.validate(),
449
+ );
450
+ export { validatePrunePure as validatePrune };
451
+
452
+ /* -----------------------------------------------------------
453
+ FACTORY FUNCTIONS
454
+ ----------------------------------------------------------- */
455
+ /**
456
+ * Creates a reusable {@link clone} function.
457
+ *
458
+ * @danger You must configure the generic argument `T`
459
+ * @returns Nothing until you configure the generic argument `T`
460
+ * @throws compile error
461
+ *
462
+ * @author Jeongho Nam - https://github.com/samchon
463
+ */
464
+ function createClone(): never;
465
+
466
+ /**
467
+ * Creates a resuable {@link clone} function.
468
+ *
469
+ * @template T Type of the input value
470
+ * @returns A reusable `clone` function
471
+ *
472
+ * @author Jeongho Nam - https://github.com/samchon
473
+ */
474
+ function createClone<T>(): (input: T) => Resolved<T>;
475
+
476
+ /**
477
+ * @internal
478
+ */
479
+ function createClone(): never {
480
+ halt("createClone");
481
+ }
482
+ const createClonePure = /** @__PURE__ */ Object.assign<typeof createClone, {}>(
483
+ createClone,
484
+ clonePure,
485
+ );
486
+ export { createClonePure as createClone };
487
+
488
+ /**
489
+ * Creates a reusable {@link assertClone} function.
490
+ *
491
+ * @danger You must configure the generic argument `T`
492
+ * @returns Nothing until you configure the generic argument `T`
493
+ * @throws compile error
494
+ *
495
+ * @author Jeongho Nam - https://github.com/samchon
496
+ */
497
+ function createAssertClone(): never;
498
+
499
+ /**
500
+ * Creates a resuable {@link assertClone} function.
501
+ *
502
+ * @template T Type of the input value
503
+ * @returns A reusable `clone` function
504
+ *
505
+ * @author Jeongho Nam - https://github.com/samchon
506
+ */
507
+ function createAssertClone<T>(): (input: unknown) => Resolved<T>;
508
+
509
+ /**
510
+ * @internal
511
+ */
512
+ function createAssertClone(): never {
513
+ halt("createAssertClone");
514
+ }
515
+ const createAssertClonePure = /** @__PURE__ */ Object.assign<
516
+ typeof createAssertClone,
517
+ {}
518
+ >(createAssertClone, assertClonePure);
519
+ export { createAssertClonePure as createAssertClone };
520
+
521
+ /**
522
+ * Creates a reusable {@link isClone} function.
523
+ *
524
+ * @danger You must configure the generic argument `T`
525
+ * @returns Nothing until you configure the generic argument `T`
526
+ * @throws compile error
527
+ *
528
+ * @author Jeongho Nam - https://github.com/samchon
529
+ */
530
+ function createIsClone(): never;
531
+
532
+ /**
533
+ * Creates a resuable {@link isClone} function.
534
+ *
535
+ * @template T Type of the input value
536
+ * @returns A reusable `clone` function
537
+ *
538
+ * @author Jeongho Nam - https://github.com/samchon
539
+ */
540
+ function createIsClone<T>(): (input: unknown) => Resolved<T> | null;
541
+
542
+ /**
543
+ * @internal
544
+ */
545
+ function createIsClone(): never {
546
+ halt("createIsClone");
547
+ }
548
+ const createIsClonePure = /** @__PURE__ */ Object.assign<
549
+ typeof createIsClone,
550
+ {}
551
+ >(createIsClone, isClonePure);
552
+ export { createIsClonePure as createIsClone };
553
+
554
+ /**
555
+ * Creates a reusable {@link validateClone} function.
556
+ *
557
+ * @danger You must configure the generic argument `T`
558
+ * @returns Nothing until you configure the generic argument `T`
559
+ * @throws compile error
560
+ *
561
+ * @author Jeongho Nam - https://github.com/samchon
562
+ */
563
+ function createValidateClone(): never;
564
+
565
+ /**
566
+ * Creates a resuable {@link validateClone} function.
567
+ *
568
+ * @template T Type of the input value
569
+ * @returns A reusable `clone` function
570
+ *
571
+ * @author Jeongho Nam - https://github.com/samchon
572
+ */
573
+ function createValidateClone<T>(): (input: unknown) => IValidation<Resolved<T>>;
574
+
575
+ /**
576
+ * @internal
577
+ */
578
+ function createValidateClone(): never {
579
+ halt("createValidateClone");
580
+ }
581
+ const createValidateClonePure = /** @__PURE__ */ Object.assign<
582
+ typeof createValidateClone,
583
+ {}
584
+ >(createValidateClone, validateClonePure);
585
+ export { createValidateClonePure as createValidateClone };
586
+
587
+ /**
588
+ * Creates a reusable {@link prune} function.
589
+ *
590
+ * @danger You must configure the generic argument `T`
591
+ * @returns Nothing until you configure the generic argument `T`
592
+ * @throws compile error
593
+ *
594
+ * @author Jeongho Nam - https://github.com/samchon
595
+ */
596
+ function createPrune(): never;
597
+
598
+ /**
599
+ * Creates a resuable {@link prune} function.
600
+ *
601
+ * @template T Type of the input value
602
+ * @returns A reusable `prune` function
603
+ *
604
+ * @author Jeongho Nam - https://github.com/samchon
605
+ */
606
+ function createPrune<T extends object>(): (input: T) => void;
607
+
608
+ /**
609
+ * @internal
610
+ */
611
+ function createPrune<T extends object>(): (input: T) => void {
612
+ halt("createPrune");
613
+ }
614
+ const createPrunePure = /** @__PURE__ */ Object.assign<typeof createPrune, {}>(
615
+ createPrune,
616
+ prunePure,
617
+ );
618
+ export { createPrunePure as createPrune };
619
+
620
+ /**
621
+ * Creates a reusable {@link assertPrune} function.
622
+ *
623
+ * @danger You must configure the generic argument `T`
624
+ * @returns Nothing until you configure the generic argument `T`
625
+ * @throws compile error
626
+ *
627
+ * @author Jeongho Nam - https://github.com/samchon
628
+ */
629
+ function createAssertPrune(): never;
630
+
631
+ /**
632
+ * Creates a resuable {@link assertPrune} function.
633
+ *
634
+ * @template T Type of the input value
635
+ * @returns A reusable `isPrune` function
636
+ *
637
+ * @author Jeongho Nam - https://github.com/samchon
638
+ */
639
+ function createAssertPrune<T extends object>(): (input: T) => T;
640
+
641
+ /**
642
+ * @internal
643
+ */
644
+ function createAssertPrune<T extends object>(): (input: T) => T {
645
+ halt("createAssertPrune");
646
+ }
647
+ const createAssertPrunePure = /** @__PURE__ */ Object.assign<
648
+ typeof createAssertPrune,
649
+ {}
650
+ >(createAssertPrune, assertPrunePure);
651
+ export { createAssertPrunePure as createAssertPrune };
652
+
653
+ /**
654
+ * Creates a reusable {@link isPrune} function.
655
+ *
656
+ * @danger You must configure the generic argument `T`
657
+ * @returns Nothing until you configure the generic argument `T`
658
+ * @throws compile error
659
+ *
660
+ * @author Jeongho Nam - https://github.com/samchon
661
+ */
662
+ function createIsPrune(): never;
663
+
664
+ /**
665
+ * Creates a resuable {@link isPrune} function.
666
+ *
667
+ * @template T Type of the input value
668
+ * @returns A reusable `isPrune` function
669
+ *
670
+ * @author Jeongho Nam - https://github.com/samchon
671
+ */
672
+ function createIsPrune<T extends object>(): (input: T) => input is T;
673
+
674
+ /**
675
+ * @internal
676
+ */
677
+ function createIsPrune<T extends object>(): (input: T) => input is T {
678
+ halt("createIsPrune");
679
+ }
680
+ const createIsPrunePure = /** @__PURE__ */ Object.assign<
681
+ typeof createIsPrune,
682
+ {}
683
+ >(createIsPrune, isPrunePure);
684
+ export { createIsPrunePure as createIsPrune };
685
+
686
+ /**
687
+ * Creates a reusable {@link validatePrune} function.
688
+ *
689
+ * @danger You must configure the generic argument `T`
690
+ * @returns Nothing until you configure the generic argument `T`
691
+ * @throws compile error
692
+ *
693
+ * @author Jeongho Nam - https://github.com/samchon
694
+ */
695
+ function createValidatePrune(): never;
696
+
697
+ /**
698
+ * Creates a resuable {@link validatePrune} function.
699
+ *
700
+ * @template T Type of the input value
701
+ * @returns A reusable `validatePrune` function
702
+ *
703
+ * @author Jeongho Nam - https://github.com/samchon
704
+ */
705
+ function createValidatePrune<T extends object>(): (input: T) => IValidation<T>;
706
+
707
+ /**
708
+ * @internal
709
+ */
710
+ function createValidatePrune<T extends object>(): (input: T) => IValidation<T> {
711
+ halt("createValidatePrune");
712
+ }
713
+ const createValidatePrunePure = /** @__PURE__ */ Object.assign<
714
+ typeof createValidatePrune,
715
+ {}
716
+ >(createValidatePrune, validatePrunePure);
717
+ export { createValidatePrunePure as createValidatePrune };
718
+
719
+ /**
720
+ * @internal
721
+ */
722
+ function halt(name: string): never {
723
+ throw new Error(
724
+ `Error on typia.misc.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
725
+ );
726
+ }