typia 3.6.2 → 3.6.4

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.
Files changed (73) hide show
  1. package/README.md +2 -1
  2. package/lib/factories/internal/metadata/emplace_metadata_object.js +8 -7
  3. package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
  4. package/lib/functional/$is_uuid.js +1 -1
  5. package/lib/functional/$is_uuid.js.map +1 -1
  6. package/lib/module.d.ts +2 -2
  7. package/package.json +1 -1
  8. package/src/executable/setup/ArgumentParser.ts +91 -91
  9. package/src/executable/setup/FileRetriever.ts +33 -33
  10. package/src/executable/setup/PackageManager.ts +92 -92
  11. package/src/executable/setup/PluginConfigurator.ts +99 -99
  12. package/src/factories/internal/metadata/emplace_metadata_object.ts +142 -140
  13. package/src/functional/$is_uuid.ts +1 -2
  14. package/src/module.ts +1946 -1946
  15. package/src/programmers/AssertCloneProgrammer.ts +70 -70
  16. package/src/programmers/AssertParseProgrammer.ts +65 -65
  17. package/src/programmers/AssertProgrammer.ts +232 -232
  18. package/src/programmers/AssertPruneProgrammer.ts +67 -67
  19. package/src/programmers/AssertStringifyProgrammer.ts +71 -71
  20. package/src/programmers/CheckerProgrammer.ts +893 -893
  21. package/src/programmers/CloneProgrammer.ts +386 -386
  22. package/src/programmers/FeatureProgrammer.ts +505 -505
  23. package/src/programmers/IsCloneProgrammer.ts +80 -80
  24. package/src/programmers/IsParseProgrammer.ts +74 -74
  25. package/src/programmers/IsPruneProgrammer.ts +75 -75
  26. package/src/programmers/IsStringifyProgrammer.ts +81 -81
  27. package/src/programmers/PruneProgrammer.ts +341 -341
  28. package/src/programmers/RandomProgrammer.ts +391 -391
  29. package/src/programmers/StringifyProgrammer.ts +795 -795
  30. package/src/programmers/ValidateCloneProgrammer.ts +90 -90
  31. package/src/programmers/ValidateParseProgrammer.ts +69 -69
  32. package/src/programmers/ValidateProgrammer.ts +266 -266
  33. package/src/programmers/ValidatePruneProgrammer.ts +83 -83
  34. package/src/programmers/ValidateStringifyProgrammer.ts +89 -89
  35. package/src/transformers/features/miscellaneous/AssertCloneTransformer.ts +9 -9
  36. package/src/transformers/features/miscellaneous/AssertPruneTransformer.ts +9 -9
  37. package/src/transformers/features/miscellaneous/CloneTransformer.ts +9 -9
  38. package/src/transformers/features/miscellaneous/CreateAssertCloneTransformer.ts +9 -9
  39. package/src/transformers/features/miscellaneous/CreateAssertPruneTransformer.ts +9 -9
  40. package/src/transformers/features/miscellaneous/CreateCloneTransformer.ts +9 -9
  41. package/src/transformers/features/miscellaneous/CreateIsCloneTransformer.ts +9 -9
  42. package/src/transformers/features/miscellaneous/CreateIsPruneTransformer.ts +9 -9
  43. package/src/transformers/features/miscellaneous/CreatePruneTransformer.ts +9 -9
  44. package/src/transformers/features/miscellaneous/CreateRandomGenerator.ts +42 -42
  45. package/src/transformers/features/miscellaneous/CreateValidateCloneTransformer.ts +9 -9
  46. package/src/transformers/features/miscellaneous/CreateValidatePruneTransformer.ts +9 -9
  47. package/src/transformers/features/miscellaneous/IsCloneTransformer.ts +9 -9
  48. package/src/transformers/features/miscellaneous/IsPruneTransformer.ts +9 -9
  49. package/src/transformers/features/miscellaneous/PruneTransformer.ts +9 -9
  50. package/src/transformers/features/miscellaneous/RandomTransformer.ts +48 -48
  51. package/src/transformers/features/miscellaneous/ValidateCloneTransformer.ts +9 -9
  52. package/src/transformers/features/miscellaneous/ValidatePruneTransformer.ts +9 -9
  53. package/src/transformers/features/parsers/AssertParseTransformer.ts +9 -9
  54. package/src/transformers/features/parsers/CreateAssertParseTransformer.ts +9 -9
  55. package/src/transformers/features/parsers/CreateIsParseTransformer.ts +9 -9
  56. package/src/transformers/features/parsers/CreateValidateParseTransformer.ts +9 -9
  57. package/src/transformers/features/parsers/IsParseTransformer.ts +9 -9
  58. package/src/transformers/features/parsers/ValidateParseTransformer.ts +9 -9
  59. package/src/transformers/features/stringifiers/AssertStringifyTransformer.ts +10 -10
  60. package/src/transformers/features/stringifiers/CreateAssertStringifyTransformer.ts +9 -9
  61. package/src/transformers/features/stringifiers/CreateIsStringifyTransformer.ts +9 -9
  62. package/src/transformers/features/stringifiers/CreateStringifyTransformer.ts +9 -9
  63. package/src/transformers/features/stringifiers/CreateValidateStringifyProgrammer.ts +11 -11
  64. package/src/transformers/features/stringifiers/IsStringifyTransformer.ts +9 -9
  65. package/src/transformers/features/stringifiers/StringifyTransformer.ts +9 -9
  66. package/src/transformers/features/stringifiers/ValidateStringifyTransformer.ts +10 -10
  67. package/src/transformers/features/validators/AssertTransformer.ts +11 -11
  68. package/src/transformers/features/validators/CreateAssertTransformer.ts +12 -12
  69. package/src/transformers/features/validators/CreateIsTransformer.ts +10 -10
  70. package/src/transformers/features/validators/CreateValidateTransformer.ts +12 -12
  71. package/src/transformers/features/validators/IsTransformer.ts +10 -10
  72. package/src/transformers/features/validators/ValidateTransformer.ts +11 -11
  73. package/src/transformers/internal/GenericTransformer.ts +99 -99
package/src/module.ts CHANGED
@@ -1,1946 +1,1946 @@
1
- import { Namespace } from "./functional/Namespace";
2
-
3
- import { IMetadataApplication } from "./metadata/IMetadataApplication";
4
- import { IJsonApplication } from "./schemas/IJsonApplication";
5
-
6
- import { IRandomGenerator } from "./IRandomGenerator";
7
- import { IValidation } from "./IValidation";
8
- import { Primitive } from "./Primitive";
9
- import { TypeGuardError } from "./TypeGuardError";
10
-
11
- export * from "./schemas/IJsonApplication";
12
- export * from "./schemas/IJsonComponents";
13
- export * from "./schemas/IJsonSchema";
14
- export * from "./IRandomGenerator";
15
- export * from "./IValidation";
16
- export * from "./Primitive";
17
- export * from "./TypeGuardError";
18
-
19
- /* ===========================================================
20
- SINGLE FUNCTIONS
21
- - BASIC VALIDATORS
22
- - STRICT VALIDATORS
23
- - JSON FUNCTIONS
24
- - MISCELLANEOUS
25
- ==============================================================
26
- BASIC VALIDATORS
27
- ----------------------------------------------------------- */
28
- /**
29
- * Asserts a value type.
30
- *
31
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
32
- * reason, if the parametric value is not following the type `T`. Otherwise, the
33
- * value is following the type `T`, just input parameter would be returned.
34
- *
35
- * If what you want is not asserting but just knowing whether the parametric value is
36
- * following the type `T` or not, you can choose the {@link is} function instead.
37
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
38
- *
39
- * On the other and, if you don't want to allow any superfluous property that is not
40
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
41
- *
42
- * @template T Type of the input value
43
- * @param input A value to be asserted
44
- * @returns Parametric input value
45
- * @throws A {@link TypeGuardError} instance with detailed reason
46
- *
47
- * @author Jeongho Nam - https://github.com/samchon
48
- */
49
- export function assert<T>(input: T): T;
50
-
51
- /**
52
- * Asserts a value type.
53
- *
54
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
55
- * reason, if the parametric value is not following the type `T`. Otherwise, the
56
- * value is following the type `T`, just input parameter would be returned.
57
- *
58
- * If what you want is not asserting but just knowing whether the parametric value is
59
- * following the type `T` or not, you can choose the {@link is} function instead.
60
- * Otherwise, you want to know all the errors, {@link validate} is the way to go.
61
- *
62
- * On the other and, if you don't want to allow any superfluous property that is not
63
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
64
- *
65
- * @template T Type of the input value
66
- * @param input A value to be asserted
67
- * @returns Parametric input value casted as `T`
68
- * @throws A {@link TypeGuardError} instance with detailed reason
69
- *
70
- * @author Jeongho Nam - https://github.com/samchon
71
- */
72
- export function assert<T>(input: unknown): T;
73
-
74
- /**
75
- * @internal
76
- */
77
- export function assert(): never {
78
- halt("assert");
79
- }
80
- Object.assign(assert, Namespace.assert("assert"));
81
-
82
- /**
83
- * Asserts a value type.
84
- *
85
- * Duplicated function of {@link assert} for `typescript-is` users.
86
- *
87
- * @template T Type of the input value
88
- * @param input A value to be asserted
89
- * @returns Parametric input value
90
- * @throws A {@link TypeGuardError} instance with detailed reason
91
- *
92
- * @author Jeongho Nam - https://github.com/samchon
93
- * @deprecated
94
- */
95
- export function assertType<T>(input: T): T;
96
-
97
- /**
98
- * Asserts a value type.
99
- *
100
- * Duplicated function of {@link assert} for `typescript-is` users.
101
- *
102
- * @template T Type of the input value
103
- * @param input A value to be asserted
104
- * @returns Parametric input value
105
- * @throws A {@link TypeGuardError} instance with detailed reason
106
- *
107
- * @author Jeongho Nam - https://github.com/samchon
108
- * @deprecated
109
- */
110
- export function assertType<T>(input: unknown): T;
111
-
112
- /**
113
- * @internal
114
- */
115
- export function assertType(): never {
116
- halt("assertType");
117
- }
118
- Object.assign(assertType, Namespace.assert("assertType"));
119
-
120
- /**
121
- * Tests a value type.
122
- *
123
- * Tests a parametric value type and returns whether it's following the type `T` or not.
124
- * If the parametric value is matched with the type `T`, `true` value would be returned.
125
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
126
- * returned.
127
- *
128
- * If what you want is not just knowing whether the parametric value is following the
129
- * type `T` or not, but throwing an exception with detailed reason, you can choose
130
- * {@link assert} function instead. Also, if you want to know all the errors with
131
- * detailed reasons, {@link validate} function would be useful.
132
- *
133
- * On the other and, if you don't want to allow any superfluous property that is not
134
- * enrolled to the type `T`, you can use {@link equals} function instead.
135
- *
136
- * @template T Type of the input value
137
- * @param input A value to be tested
138
- * @returns Whether the parametric value is following the type `T` or not
139
- *
140
- * @author Jeongho Nam - https://github.com/samchon
141
- */
142
- export function is<T>(input: T): input is T;
143
-
144
- /**
145
- * Tests a value type.
146
- *
147
- * Tests a parametric value type and returns whether it's following the type `T` or not.
148
- * If the parametric value is matched with the type `T`, `true` value would be returned.
149
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
150
- * returned.
151
- *
152
- * If what you want is not just knowing whether the parametric value is following the
153
- * type `T` or not, but throwing an exception with detailed reason, you can choose
154
- * {@link assert} function instead. Also, if you want to know all the errors with
155
- * detailed reasons, {@link validate} function would be useful.
156
- *
157
- * On the other and, if you don't want to allow any superfluous property that is not
158
- * enrolled to the type `T`, you can use {@link equals} function instead.
159
- *
160
- * @template T Type of the input value
161
- * @param input A value to be tested
162
- * @returns Whether the parametric value is following the type `T` or not
163
- *
164
- * @author Jeongho Nam - https://github.com/samchon
165
- */
166
- export function is<T>(input: unknown): input is T;
167
-
168
- /**
169
- * @internal
170
- */
171
- export function is(): never {
172
- halt("is");
173
- }
174
- Object.assign(is, Namespace.assert("is"));
175
-
176
- /**
177
- * Validates a value type.
178
- *
179
- * Validates a parametric value type and archives all the type errors into an
180
- * {@link IValidation.errors} array, if the parametric value is not following the
181
- * type `T`. Of course, if the parametric value is following the type `T`, the
182
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
183
- * would have the `true` value.
184
- *
185
- * If what you want is not finding all the error, but asserting the parametric value
186
- * type with exception throwing, you can choose {@link assert} function instead.
187
- * Otherwise, you just want to know whether the parametric value is matched with the
188
- * type `T`, {@link is} function is the way to go.
189
- *
190
- * On the other and, if you don't want to allow any superfluous property that is not
191
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
192
- *
193
- * @template Type of the input value
194
- * @param input A value to be validated
195
- * @returns Validation result
196
- *
197
- * @author Jeongho Nam - https://github.com/samchon
198
- */
199
- export function validate<T>(input: T): IValidation<T>;
200
-
201
- /**
202
- * Validates a value type.
203
- *
204
- * Validates a parametric value type and archives all the type errors into an
205
- * {@link IValidation.errors} array, if the parametric value is not following the
206
- * type `T`. Of course, if the parametric value is following the type `T`, the
207
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
208
- * would have the `true` value.
209
- *
210
- * If what you want is not finding all the error, but asserting the parametric value
211
- * type with exception throwing, you can choose {@link assert} function instead.
212
- * Otherwise, you just want to know whether the parametric value is matched with the
213
- * type `T`, {@link is} function is the way to go.
214
- *
215
- * On the other and, if you don't want to allow any superfluous property that is not
216
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
217
- *
218
- * @template Type of the input value
219
- * @param input A value to be validated
220
- * @returns Validation result
221
- *
222
- * @author Jeongho Nam - https://github.com/samchon
223
- */
224
- export function validate<T>(input: unknown): IValidation<T>;
225
-
226
- /**
227
- * @internal
228
- */
229
- export function validate(): never {
230
- halt("validate");
231
- }
232
- Object.assign(validate, Namespace.validate());
233
-
234
- /* -----------------------------------------------------------
235
- STRICT VALIDATORS
236
- ----------------------------------------------------------- */
237
- /**
238
- * Asserts equality between a value and its type.
239
- *
240
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
241
- * reason, if the parametric value is not following the type `T` or some superfluous
242
- * property that is not listed on the type `T` has been found. Otherwise, the value is
243
- * following the type `T` without any superfluous property, just input parameter would
244
- * be returned.
245
- *
246
- * If what you want is not asserting but just knowing whether the parametric value is
247
- * following the type `T` or not, you can choose the {@link equals} function instead.
248
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
249
- *
250
- * On the other hand, if you want to allow superfluous property that is not enrolled
251
- * to the type `T`, you can use {@link assert} function instead.
252
- *
253
- * @template T Type of the input value
254
- * @param input A value to be asserted
255
- * @returns Parametric input value
256
- * @throws A {@link TypeGuardError} instance with detailed reason
257
- *
258
- * @author Jeongho Nam - https://github.com/samchon
259
- */
260
- export function assertEquals<T>(input: T): T;
261
-
262
- /**
263
- * Asserts equality between a value and its type.
264
- *
265
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
266
- * reason, if the parametric value is not following the type `T` or some superfluous
267
- * property that is not listed on the type `T` has been found. Otherwise, the value is
268
- * following the type `T` without any superfluous property, just input parameter would
269
- * be returned.
270
- *
271
- * If what you want is not asserting but just knowing whether the parametric value is
272
- * following the type `T` or not, you can choose the {@link equals} function instead.
273
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
274
- *
275
- * On the other hand, if you want to allow superfluous property that is not enrolled
276
- * to the type `T`, you can use {@link assert} function instead.
277
- *
278
- * @template T Type of the input value
279
- * @param input A value to be asserted
280
- * @returns Parametric input value casted as `T`
281
- * @throws A {@link TypeGuardError} instance with detailed reason
282
- *
283
- * @author Jeongho Nam - https://github.com/samchon
284
- */
285
- export function assertEquals<T>(input: unknown): T;
286
-
287
- /**
288
- * @internal
289
- */
290
- export function assertEquals(): never {
291
- halt("assertEquals");
292
- }
293
- Object.assign(assertEquals, Namespace.assert("assertEquals"));
294
-
295
- /**
296
- * Tests equality between a value and its type.
297
- *
298
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
299
- * or not. If the parametric value is matched with the type `T` and there's not any
300
- * superfluous property that is not listed on the type `T`, `true` value would be
301
- * returned. Otherwise, the parametric value is not following the type `T` or some
302
- * superfluous property exists, `false` value would be returned.
303
- *
304
- * If what you want is not just knowing whether the parametric value is following the
305
- * type `T` or not, but throwing an exception with detailed reason, you can choose
306
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
307
- * detailed reasons, {@link validateEquals} function would be useful.
308
- *
309
- * On the other hand, if you want to allow superfluous property that is not enrolled
310
- * to the type `T`, you can use {@link is} function instead.
311
- *
312
- * @template T Type of the input value
313
- * @param input A value to be tested
314
- * @returns Whether the parametric value is equivalent to the type `T` or not
315
- *
316
- * @author Jeongho Nam - https://github.com/samchon
317
- */
318
- export function equals<T>(input: T): input is T;
319
-
320
- /**
321
- * Tests equality between a value and its type.
322
- *
323
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
324
- * or not. If the parametric value is matched with the type `T` and there's not any
325
- * superfluous property that is not listed on the type `T`, `true` value would be
326
- * returned. Otherwise, the parametric value is not following the type `T` or some
327
- * superfluous property exists, `false` value would be returned.
328
- *
329
- * If what you want is not just knowing whether the parametric value is following the
330
- * type `T` or not, but throwing an exception with detailed reason, you can choose
331
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
332
- * detailed reasons, {@link validateEquals} function would be useful.
333
- *
334
- * On the other hand, if you want to allow superfluous property that is not enrolled
335
- * to the type `T`, you can use {@link is} function instead.
336
- *
337
- * @template T Type of the input value
338
- * @param input A value to be tested
339
- * @returns Whether the parametric value is equivalent to the type `T` or not
340
- *
341
- * @author Jeongho Nam - https://github.com/samchon
342
- */
343
- export function equals<T>(input: unknown): input is T;
344
-
345
- /**
346
- * @internal
347
- */
348
- export function equals(): never {
349
- halt("equals");
350
- }
351
- Object.assign(equals, Namespace.is());
352
-
353
- /**
354
- * Validates equality between a value and its type.
355
- *
356
- * Validates a parametric value type and archives all the type errors into an
357
- * {@link IValidation.errors} array, if the parametric value is not following the
358
- * type `T` or some superfluous property that is not listed on the type `T` has been
359
- * found. Of course, if the parametric value is following the type `T` and no
360
- * superfluous property exists, the {@link IValidation.errors} array would be empty
361
- * and {@link IValidation.success} would have the `true` value.
362
- *
363
- * If what you want is not finding all the error, but asserting the parametric value
364
- * type with exception throwing, you can choose {@link assert} function instead.
365
- * Otherwise, you just want to know whether the parametric value is matched with the
366
- * type `T`, {@link is} function is the way to go.
367
- *
368
- * On the other and, if you don't want to allow any superfluous property that is not
369
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
370
- *
371
- * @template Type of the input value
372
- * @param input A value to be validated
373
- * @returns Validation result
374
- *
375
- * @author Jeongho Nam - https://github.com/samchon
376
- */
377
- export function validateEquals<T>(input: T): IValidation<T>;
378
-
379
- /**
380
- * Validates equality between a value and its type.
381
- *
382
- * Validates a parametric value type and archives all the type errors into an
383
- * {@link IValidation.errors} array, if the parametric value is not following the
384
- * type `T` or some superfluous property that is not listed on the type `T` has been
385
- * found. Of course, if the parametric value is following the type `T` and no
386
- * superfluous property exists, the {@link IValidation.errors} array would be empty
387
- * and {@link IValidation.success} would have the `true` value.
388
- *
389
- * If what you want is not finding all the error, but asserting the parametric value
390
- * type with exception throwing, you can choose {@link assert} function instead.
391
- * Otherwise, you just want to know whether the parametric value is matched with the
392
- * type `T`, {@link is} function is the way to go.
393
- *
394
- * On the other and, if you don't want to allow any superfluous property that is not
395
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
396
- *
397
- * @template Type of the input value
398
- * @param input A value to be validated
399
- * @returns Validation result
400
- *
401
- * @author Jeongho Nam - https://github.com/samchon
402
- */
403
- export function validateEquals<T>(input: unknown): IValidation<T>;
404
-
405
- /**
406
- * @internal
407
- */
408
- export function validateEquals(): never {
409
- halt("validateEquals");
410
- }
411
- Object.assign(validateEquals, Namespace.validate());
412
-
413
- /* -----------------------------------------------------------
414
- JSON FUNCTIONS
415
- ----------------------------------------------------------- */
416
- /**
417
- * > You must configure the generic argument `T`.
418
- *
419
- * JSON Schema Application.
420
- *
421
- * Creates a JSON schema application which contains both main JSON schemas and components.
422
- * Note that, all of the object types are stored in the {@link IJsonApplication.components}
423
- * property for the `$ref` referencing.
424
- *
425
- * Also, `typia.application()` has additional generic arguments, *Purpose*.
426
- * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
427
- * you should configure the *Purpose* appropriately.
428
- *
429
- * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
430
- * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
431
- * the tuple definition.
432
- *
433
- * @template Types Tuple of target types
434
- * @template Purpose Purpose of the JSON schema`
435
- * @template Prefix Prefix of the JSON components referenced by `$ref` tag
436
- * @return JSON schema application
437
- *
438
- * @author Jeongho Nam - https://github.com/samchon
439
- */
440
- export function application(): never;
441
-
442
- /**
443
- * JSON Schema Application.
444
- *
445
- * Creates a JSON schema application which contains both main JSON schemas and components.
446
- * Note that, all of the object types are stored in the {@link IJsonApplication.components}
447
- * property for the `$ref` referencing.
448
- *
449
- * Also, `typia.application()` has additional generic arguments, *Purpose*.
450
- * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
451
- * you should configure the *Purpose* appropriately.
452
- *
453
- * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
454
- * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
455
- * the tuple definition.
456
- *
457
- * @template Types Tuple of target types
458
- * @template Purpose Purpose of the JSON schema
459
- * @template Prefix Prefix of the JSON components referenced by `$ref` tag
460
- * @return JSON schema application
461
- *
462
- * @author Jeongho Nam - https://github.com/samchon
463
- */
464
- export function application<
465
- Types extends unknown[],
466
- Purpose extends "swagger" | "ajv" = "swagger",
467
- Prefix extends string = Purpose extends "swagger"
468
- ? "#/components/schemas"
469
- : "components#/schemas",
470
- >(): IJsonApplication;
471
-
472
- /**
473
- * @internal
474
- */
475
- export function application(): never {
476
- halt("application");
477
- }
478
-
479
- /**
480
- * > You must configure the generic argument `T`.
481
- *
482
- * Safe `JSON.parse()` function with type assertion.
483
- *
484
- * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
485
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
486
- * instance with type assertion.
487
- *
488
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
489
- * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
490
- * the parsed value would be returned.
491
- *
492
- * @template T Expected type of parsed value
493
- * @param input JSON string
494
- * @returns Parsed value
495
- *
496
- * @author Jeongho Nam - https://github.com/samchon
497
- */
498
- export function assertParse(input: string): never;
499
-
500
- /**
501
- * Safe `JSON.parse()` function with type assertion.
502
- *
503
- * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
504
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
505
- * instance with type assertion.
506
- *
507
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
508
- * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
509
- * the parsed value would be returned.
510
- *
511
- * @template T Expected type of parsed value
512
- * @param input JSON string
513
- * @returns Parsed value
514
- *
515
- * @author Jeongho Nam - https://github.com/samchon
516
- */
517
- export function assertParse<T>(input: string): T;
518
-
519
- /**
520
- * @internal
521
- */
522
- export function assertParse<T>(): T {
523
- halt("assertParse");
524
- }
525
- Object.assign(assertParse, Namespace.assert("assertParse"));
526
-
527
- /**
528
- * > You must configure the generic argument `T`.
529
- *
530
- * Safe `JSON.parse()` function with type checking.
531
- *
532
- * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
533
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
534
- * instance with type checking.
535
- *
536
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
537
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
538
- * value would be returned.
539
- *
540
- * @template T Expected type of parsed value
541
- * @param input JSON string
542
- * @returns Parsed value when exact type, otherwise `null`
543
- *
544
- * @author Jeongho Nam - https://github.com/samchon
545
- */
546
- export function isParse(input: string): never;
547
-
548
- /**
549
- * Safe `JSON.parse()` function with type checking.
550
- *
551
- * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
552
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
553
- * instance with type checking.
554
- *
555
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
556
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
557
- * value would be returned.
558
- *
559
- * @template T Expected type of parsed value
560
- * @param input JSON string
561
- * @returns Parsed value when exact type, otherwise `null`
562
- *
563
- * @author Jeongho Nam - https://github.com/samchon
564
- */
565
- export function isParse<T>(input: string): T | null;
566
-
567
- /**
568
- * @internal
569
- */
570
- export function isParse<T>(): T | null {
571
- halt("isParse");
572
- }
573
- Object.assign(isParse, is);
574
-
575
- /**
576
- * > You must configure the generic argument `T`.
577
- *
578
- * Safe `JSON.parse()` function with detailed type validation.
579
- *
580
- * `typia.validateParse()` is a combination function of `JSON.parse()` and
581
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
582
- * to a `T` typed instance with detailed type validation.
583
- *
584
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
585
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
586
- * there's no problem on the parsed value, the parsed value would be stored in `data`
587
- * property of the output {@link IValidation.ISuccess} instance.
588
- *
589
- * @template T Expected type of parsed value
590
- * @param input JSON string
591
- * @returns Validation result with JSON parsed value
592
- *
593
- * @author Jeongho Nam - https://github.com/samchon
594
- */
595
- export function validateParse(input: string): never;
596
-
597
- /**
598
- * Safe `JSON.parse()` function with detailed type validation.
599
- *
600
- * `typia.validateParse()` is a combination function of `JSON.parse()` and
601
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
602
- * to a `T` typed instance with detailed type validation.
603
- *
604
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
605
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
606
- * there's no problem on the parsed value, the parsed value would be stored in `data`
607
- * property of the output {@link IValidation.ISuccess} instance.
608
- *
609
- * @template T Expected type of parsed value
610
- * @param input JSON string
611
- * @returns Validation result with JSON parsed value
612
- *
613
- * @author Jeongho Nam - https://github.com/samchon
614
- */
615
- export function validateParse<T>(input: string): IValidation<T>;
616
-
617
- /**
618
- * @internal
619
- */
620
- export function validateParse<T>(): IValidation<T> {
621
- halt("validateParse");
622
- }
623
- Object.assign(validateParse, validate);
624
-
625
- /**
626
- * 8x faster `JSON.stringify()` function.
627
- *
628
- * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x faster
629
- * than the native `JSON.stringify()` function. The 5x faster principle is because
630
- * it writes an optimized JSON conversion plan, only for the type `T`.
631
- *
632
- * For reference, this `typia.stringify()` does not validate the input value type.
633
- * It just believes that the input value is following the type `T`. Therefore, if you
634
- * can't ensure the input value type, it would be better to call one of below functions
635
- * instead.
636
- *
637
- * - {@link assertStringify}
638
- * - {@link isStringify}
639
- * - {@link validateStringify}
640
- *
641
- * @template T Type of the input value
642
- * @param input A value to be converted
643
- * @return JSON string value
644
- *
645
- * @author Jeongho Nam - https://github.com/samchon
646
- */
647
- export function stringify<T>(input: T): string;
648
-
649
- /**
650
- * @internal
651
- */
652
- export function stringify(): never {
653
- halt("stringify");
654
- }
655
- Object.assign(stringify, Namespace.stringify("stringify"));
656
-
657
- /**
658
- * 5x faster `JSON.stringify()` function with type assertion.
659
- *
660
- * `typia.assertStringify()` is a combination function of {@link assert} and
661
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
662
- * Notation) string, with type assertion.
663
- *
664
- * In such reason, when `input` value is not matched with the type `T`, it throws an
665
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
666
- * string would be returned.
667
- *
668
- * For reference, with type assertion, it is even 5x times faster than the native
669
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
670
- * with confidence.
671
- *
672
- * @template T Type of the input value
673
- * @param input A value to be asserted and converted
674
- * @return JSON string value
675
- *
676
- * @author Jeongho Nam - https://github.com/samchon
677
- */
678
- export function assertStringify<T>(input: T): string;
679
-
680
- /**
681
- * 5x faster `JSON.stringify()` function with type assertion.
682
- *
683
- * `typia.assertStringify()` is a combination function of {@link assert} and
684
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
685
- * Notation) string, with type assertion.
686
- *
687
- * In such reason, when `input` value is not matched with the type `T`, it throws an
688
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
689
- * string would be returned.
690
- *
691
- * For reference, with type assertion, it is even 5x times faster than the native
692
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
693
- * with confidence.
694
- *
695
- * @template T Type of the input value
696
- * @param input A value to be asserted and converted
697
- * @return JSON string value
698
- *
699
- * @author Jeongho Nam - https://github.com/samchon
700
- */
701
- export function assertStringify<T>(input: T): unknown;
702
-
703
- /**
704
- * @internal
705
- */
706
- export function assertStringify(): string {
707
- halt("assertStringify");
708
- }
709
- Object.assign(assertStringify, Namespace.assert("assertStringify"));
710
- Object.assign(assertStringify, Namespace.stringify("assertStringify"));
711
-
712
- /**
713
- * 7x faster `JSON.stringify()` function with type checking.
714
- *
715
- * `typia.stringify()` is a combination function of {@link is} and
716
- * {@link stringify}. Therefore, it converts an input value to JSON
717
- * (JavaScript Object Notation) string, with type checking.
718
- *
719
- * In such reason, when `input` value is not matched with the type `T`, it returns
720
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
721
- * be returned.
722
- *
723
- * For reference, with type checking, it is even 7x times faster than the native
724
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
725
- * with confidence.
726
- *
727
- * @template T Type of the input value
728
- * @param input A value to be checked and converted
729
- * @return JSON string value when exact type, otherwise null
730
- *
731
- * @author Jeongho Nam - https://github.com/samchon
732
- */
733
- export function isStringify<T>(input: T): string | null;
734
-
735
- /**
736
- * 7x faster `JSON.stringify()` function with type checking.
737
- *
738
- * `typia.isStringify()` is a combination function of {@link is} and
739
- * {@link stringify}. Therefore, it converts an input value to JSON
740
- * (JavaScript Object Notation) string, with type checking.
741
- *f
742
- * In such reason, when `input` value is not matched with the type `T`, it returns
743
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
744
- * be returned.
745
- *
746
- * For reference, with type checking, it is even 7x times faster than the native
747
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
748
- * with confidence.
749
- *
750
- * @template T Type of the input value
751
- * @param input A value to be checked and converted
752
- * @return JSON string value when exact type, otherwise null
753
- *
754
- * @author Jeongho Nam - https://github.com/samchon
755
- */
756
- export function isStringify<T>(input: unknown): string | null;
757
-
758
- /**
759
- * @internal
760
- */
761
- export function isStringify(): string | null {
762
- halt("isStringify");
763
- }
764
-
765
- Object.assign(isStringify, Namespace.is());
766
- Object.assign(isStringify, Namespace.stringify("isStringify"));
767
-
768
- /**
769
- * 5x faster `JSON.stringify()` function with detailed type validation.
770
- *
771
- * `typia.validateStringify()` is a combination function of {@link validate} and
772
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
773
- * Notation) string, with detailed type validation.
774
- *
775
- * In such reason, when `input` value is not matched with the type `T`, it returns
776
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
777
- * problem on the `input` value, JSON string would be stored in `data` property of
778
- * the output {@link IValidation.ISuccess} instance.
779
- *
780
- * For reference, with detailed type validation, it is even 5x times faster than the
781
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
782
- * with confidence.
783
- *
784
- * @template T Type of the input value
785
- * @param input A value to be checked and converted
786
- * @returns Validation result with JSON string value
787
- *
788
- * @author Jeongho Nam - https://github.com/samchon
789
- */
790
- export function validateStringify<T>(input: T): IValidation<string>;
791
-
792
- /**
793
- * 5x faster `JSON.stringify()` function with detailed type validation.
794
- *
795
- * `typia.validateStringify()` is a combination function of {@link validate} and
796
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
797
- * Notation) string, with detailed type validation.
798
- *
799
- * In such reason, when `input` value is not matched with the type `T`, it returns
800
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
801
- * problem on the `input` value, JSON string would be stored in `data` property of
802
- * the output {@link IValidation.ISuccess} instance.
803
- *
804
- * For reference, with detailed type validation, it is even 5x times faster than the
805
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
806
- * with confidence.
807
- *
808
- * @template T Type of the input value
809
- * @param input A value to be checked and converted
810
- * @returns Validation result with JSON string value
811
- *
812
- * @author Jeongho Nam - https://github.com/samchon
813
- */
814
- export function validateStringify<T>(input: unknown): IValidation<string>;
815
-
816
- /**
817
- * @internal
818
- */
819
- export function validateStringify(): IValidation<string> {
820
- halt("validateStringify");
821
- }
822
- Object.assign(validateStringify, Namespace.validate());
823
- Object.assign(validateStringify, Namespace.stringify("validateStringify"));
824
-
825
- /* -----------------------------------------------------------
826
- MISCELLANEOUS
827
- ----------------------------------------------------------- */
828
- /**
829
- * @internal
830
- */
831
- export function metadata(): never;
832
-
833
- /**
834
- * @internal
835
- */
836
- export function metadata<Types extends unknown[]>(): IMetadataApplication;
837
-
838
- /**
839
- * @internal
840
- */
841
- export function metadata(): never {
842
- halt("metadata");
843
- }
844
-
845
- /**
846
- * > You must configure the generic argument `T`.
847
- *
848
- * Generate random data.
849
- *
850
- * Generates a random data following type the `T`.
851
- *
852
- * For reference, this `typia.random()` function generates only primitive type.
853
- * If there're some methods in the type `T` or its nested instances, those would
854
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
855
- * would be generated instead.
856
- *
857
- * @template T Type of data to generate
858
- * @param generator Random data generator
859
- * @return Randomly generated data
860
- *
861
- * @author Jeongho Nam - https://github.com/samchon
862
- */
863
- export function random(generator?: Partial<IRandomGenerator>): never;
864
-
865
- /**
866
- * Generate random data.
867
- *
868
- * Generates a random data following type the `T`.
869
- *
870
- * For reference, this `typia.random()` function generates only primitive type.
871
- * If there're some methods in the type `T` or its nested instances, those would
872
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
873
- * would be generated instead.
874
- *
875
- * @template T Type of data to generate
876
- * @param generator Random data generator
877
- * @return Randomly generated data
878
- *
879
- * @author Jeongho Nam - https://github.com/samchon
880
- */
881
- export function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
882
-
883
- /**
884
- * @internal
885
- */
886
- export function random(): never {
887
- halt("random");
888
- }
889
- Object.assign(random, Namespace.random());
890
-
891
- /**
892
- * Clone a data.
893
- *
894
- * Clones an instance following type `T`. If the target *input* value or its member
895
- * variable contains a class instance that is having a `toJSON()` method, its return
896
- * value would be cloned.
897
- *
898
- * For reference, this `typia.clone()` function does not validate the input value type.
899
- * It just believes that the input value is following the type `T`. Therefore, if you
900
- * can't ensure the input value type, it would be better to call {@link assertClone}
901
- * function instead.
902
- *
903
- * @template T Type of the input value
904
- * @param input A value to be cloned
905
- * @return Cloned data
906
- *
907
- * @author Jeongho Nam - https://github.com/samchon
908
- */
909
- export function clone<T>(input: T): Primitive<T>;
910
-
911
- /**
912
- * @internal
913
- */
914
- export function clone(): never {
915
- halt("clone");
916
- }
917
- Object.assign(clone, Namespace.clone("clone"));
918
-
919
- /**
920
- * Clone a data with type assertion.
921
- *
922
- * Clones an instance following type `T`, with type assertion. If the target `input`
923
- * value or its member variable contains a class instance that is having a `toJSON()`
924
- * method, its return value would be cloned.
925
- *
926
- * In such reason, when `input` value is not matched with the type `T`, it throws an
927
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
928
- * data would be returned.
929
- *
930
- * @template T Type of the input value
931
- * @param input A value to be cloned
932
- * @return Cloned data
933
- *
934
- * @author Jeongho Nam - https://github.com/samchon
935
- */
936
- export function assertClone<T>(input: T): Primitive<T>;
937
-
938
- /**
939
- * Clone a data with type assertion.
940
- *
941
- * Clones an instance following type `T`, with type assertion. If the target `input`
942
- * value or its member variable contains a class instance that is having a `toJSON()`
943
- * method, its return value would be cloned.
944
- *
945
- * In such reason, when `input` value is not matched with the type `T`, it throws an
946
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
947
- * data would be returned.
948
- *
949
- * @template T Type of the input value
950
- * @param input A value to be cloned
951
- * @return Cloned data
952
- *
953
- * @author Jeongho Nam - https://github.com/samchon
954
- */
955
- export function assertClone<T>(input: unknown): Primitive<T>;
956
-
957
- /**
958
- * @internal
959
- */
960
- export function assertClone(): never {
961
- halt("assertClone");
962
- }
963
- Object.assign(assertClone, Namespace.assert("assertClone"));
964
- Object.assign(assertClone, Namespace.clone("assertClone"));
965
-
966
- /**
967
- * Clone a data with type checking.
968
- *
969
- * Clones an instance following type `T`, with type checking. If the target `input`
970
- * value or its member variable contains a class instance that is having a `toJSON()`
971
- * method, its return value would be cloned.
972
- *
973
- * In such reason, when `input` value is not matched with the type `T`, it returns
974
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
975
- * data would be returned.
976
- *
977
- * @template T Type of the input value
978
- * @param input A value to be cloned
979
- * @return Cloned data when exact type, otherwise null
980
- *
981
- * @author Jeongho Nam - https://github.com/samchon
982
- */
983
- export function isClone<T>(input: T): Primitive<T> | null;
984
-
985
- /**
986
- * Clone a data with type checking.
987
- *
988
- * Clones an instance following type `T`, with type checking. If the target `input`
989
- * value or its member variable contains a class instance that is having a `toJSON()`
990
- * method, its return value would be cloned.
991
- *
992
- * In such reason, when `input` value is not matched with the type `T`, it returns
993
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
994
- * data would be returned.
995
- *
996
- * @template T Type of the input value
997
- * @param input A value to be cloned
998
- * @return Cloned data when exact type, otherwise null
999
- *
1000
- * @author Jeongho Nam - https://github.com/samchon
1001
- */
1002
- export function isClone<T>(input: unknown): Primitive<T> | null;
1003
-
1004
- /**
1005
- * @internal
1006
- */
1007
- export function isClone(): never {
1008
- halt("isClone");
1009
- }
1010
- Object.assign(isClone, Namespace.is());
1011
- Object.assign(isClone, Namespace.clone("isClone"));
1012
-
1013
- /**
1014
- * Clone a data with detailed type validation.
1015
- *
1016
- * Clones an instance following type `T`, with detailed type validation. If the target
1017
- * `input` value or its member variable contains a class instance that is having a
1018
- * `toJSON()` method, its return value would be cloned.
1019
- *
1020
- * In such reason, when `input` value is not matched with the type `T`, it returns
1021
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1022
- * value, cloned data would be stored in `data` property of the output
1023
- * {@link IValidation.Success} instance.
1024
- *
1025
- * @template T Type of the input value
1026
- * @param input A value to be cloned
1027
- * @returns Validation result with cloned value
1028
- */
1029
- export function validateClone<T>(input: T): IValidation<Primitive<T>>;
1030
-
1031
- /**
1032
- * Clone a data with detailed type validation.
1033
- *
1034
- * Clones an instance following type `T`, with detailed type validation. If the target
1035
- * `input` value or its member variable contains a class instance that is having a
1036
- * `toJSON()` method, its return value would be cloned.
1037
- *
1038
- * In such reason, when `input` value is not matched with the type `T`, it returns
1039
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1040
- * value, cloned data would be stored in `data` property of the output
1041
- * {@link IValidation.Success} instance.
1042
- *
1043
- * @template T Type of the input value
1044
- * @param input A value to be cloned
1045
- * @returns Validation result with cloned value
1046
- */
1047
- export function validateClone<T>(input: unknown): IValidation<Primitive<T>>;
1048
-
1049
- /**
1050
- * @internal
1051
- */
1052
- export function validateClone(): never {
1053
- halt("validateClone");
1054
- }
1055
- Object.assign(validateClone, Namespace.validate());
1056
- Object.assign(validateClone, Namespace.clone("validateClone"));
1057
-
1058
- /**
1059
- * Prune, erase superfluous properties.
1060
- *
1061
- * Remove every superfluous properties from the `input` object, even including nested
1062
- * objects. Note that, as every superfluous properties would be deleted, you never can
1063
- * read those superfluous properties after calling this `prune()` function.
1064
- *
1065
- * For reference, this `typia.prune()` function does not validate the input value type.
1066
- * It just believes that the input value is following the type `T`. Therefore, if you
1067
- * can't ensure the input value type, it would better to call one of below functions
1068
- * instead.
1069
- *
1070
- * - {@link assertPrune}
1071
- * - {@link isPrune}
1072
- * - {@link validatePrune}
1073
- *
1074
- * @template T Type of the input value
1075
- * @param input Target instance to prune
1076
- *
1077
- * @author Jeongho Nam - https://github.com/samchon
1078
- */
1079
- export function prune<T extends object>(input: T): void;
1080
-
1081
- /**
1082
- * @internal
1083
- */
1084
- export function prune(): never {
1085
- halt("prune");
1086
- }
1087
- Object.assign(prune, Namespace.prune("prune"));
1088
-
1089
- /**
1090
- * Prune, erase superfluous properties, with type assertion.
1091
- *
1092
- * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1093
- * Therefore, it removes every superfluous properties from the `input` object including
1094
- * nested objects, with type assertion.
1095
- *
1096
- * In such reason, when `input` value is not matched with the type `T`, it throws an
1097
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1098
- * every superfluous properties would be removed, including nested objects.
1099
- *
1100
- * @template T Type of the input value
1101
- * @param input Target instance to assert and prune
1102
- *
1103
- * @author Jeongho Nam - https://github.com/samchon
1104
- */
1105
- export function assertPrune<T>(input: T): T;
1106
-
1107
- /**
1108
- * Prune, erase superfluous properties, with type assertion.
1109
- *
1110
- * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1111
- * Therefore, it removes every superfluous properties from the `input` object including
1112
- * nested objects, with type assertion.
1113
- *
1114
- * In such reason, when `input` value is not matched with the type `T`, it throws an
1115
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1116
- * every superfluous properties would be removed, including nested objects.
1117
- *
1118
- * @template T Type of the input value
1119
- * @param input Target instance to assert and prune
1120
- *
1121
- * @author Jeongho Nam - https://github.com/samchon
1122
- */
1123
- export function assertPrune<T>(input: unknown): T;
1124
-
1125
- /**
1126
- * @internal
1127
- */
1128
- export function assertPrune(): unknown {
1129
- halt("assertPrune");
1130
- }
1131
- Object.assign(assertPrune, Namespace.assert("assertPrune"));
1132
- Object.assign(assertPrune, Namespace.prune("assertPrune"));
1133
-
1134
- /**
1135
- * Prune, erase superfluous properties, with type checking.
1136
- *
1137
- * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1138
- * Therefore, it removes every superfluous properties from the `input` object including
1139
- * nested objects, with type checking.
1140
- *
1141
- * In such reason, when `input` value is not matched with the type `T`, it returns
1142
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
1143
- * `true` after removing every superfluous properties, including nested objects.
1144
- *
1145
- * @template T Type of the input value
1146
- * @param input Target instance to check and prune
1147
- * @returns Whether the parametric value is following the type `T` or not
1148
- *
1149
- * @author Jeongho Nam - https://github.com/samchon
1150
- */
1151
- export function isPrune<T>(input: T): input is T;
1152
-
1153
- /**
1154
- * Prune, erase superfluous properties, with type checking.
1155
- *
1156
- * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1157
- * Therefore, it removes every superfluous properties from the `input` object including
1158
- * nested objects, with type checking.
1159
- *
1160
- * In such reason, when `input` value is not matched with the type `T`, it returns
1161
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
1162
- * `true` after removing every superfluous properties, including nested objects.
1163
- *
1164
- * @template T Type of the input value
1165
- * @param input Target instance to check and prune
1166
- * @returns Whether the parametric value is following the type `T` or not
1167
- *
1168
- * @author Jeongho Nam - https://github.com/samchon
1169
- */
1170
- export function isPrune<T>(input: unknown): input is T;
1171
-
1172
- /**
1173
- * @internal
1174
- */
1175
- export function isPrune(): never {
1176
- halt("isPrune");
1177
- }
1178
- Object.assign(isPrune, Namespace.is());
1179
- Object.assign(isPrune, Namespace.prune("isPrune"));
1180
-
1181
- /**
1182
- * Prune, erase superfluous properties, with type validation.
1183
- *
1184
- * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1185
- * Therefore, it removes every superfluous properties from the `input` object including
1186
- * nested objects, with type validation.
1187
- *
1188
- * In such reason, when `input` value is not matched with the type `T`, it returns
1189
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1190
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1191
- * removing every superfluous properties, including nested objects.
1192
- *
1193
- * @template T Type of the input value
1194
- * @param input Target instance to validate and prune
1195
- * @returns Validation result
1196
- *
1197
- * @author Jeongho Nam - https://github.com/samchon
1198
- */
1199
- export function validatePrune<T>(input: T): IValidation<T>;
1200
-
1201
- /**
1202
- * Prune, erase superfluous properties, with type validation.
1203
- *
1204
- * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1205
- * Therefore, it removes every superfluous properties from the `input` object including
1206
- * nested objects, with type validation.
1207
- *
1208
- * In such reason, when `input` value is not matched with the type `T`, it returns
1209
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1210
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1211
- * removing every superfluous properties, including nested objects.
1212
- *
1213
- * @template T Type of the input value
1214
- * @param input Target instance to validate and prune
1215
- * @returns Validation result
1216
- *
1217
- * @author Jeongho Nam - https://github.com/samchon
1218
- */
1219
- export function validatePrune<T>(input: unknown): IValidation<T>;
1220
-
1221
- /**
1222
- * @internal
1223
- */
1224
- export function validatePrune<T>(): IValidation<T> {
1225
- halt("validatePrune");
1226
- }
1227
- Object.assign(validatePrune, Namespace.prune("validatePrune"));
1228
- Object.assign(validatePrune, Namespace.validate());
1229
-
1230
- /* ===========================================================
1231
- FACTORY FUNCTIONS
1232
- - BASIC VALIDATORS
1233
- - STRICT VALIDATORS
1234
- - JSON FUNCTIONS
1235
- - MISCELLANEOUS
1236
- ==============================================================
1237
- BASIC VALIDATORS
1238
- ----------------------------------------------------------- */
1239
- /**
1240
- * Creates a reusable {@link assert} function.
1241
- *
1242
- * @danger You have to specify the generic argument `T`
1243
- * @return Nothing until specifying the generic argument `T`
1244
- * @throws compile error
1245
- *
1246
- * @author Jeongho Nam - https://github.com/samchon
1247
- */
1248
- export function createAssert(): never;
1249
-
1250
- /**
1251
- * Creates a reusable {@link assert} function.
1252
- *
1253
- * @template T Type of the input value
1254
- * @returns A reusable `assert` function
1255
- *
1256
- * @author Jeongho Nam - https://github.com/samchon
1257
- */
1258
- export function createAssert<T>(): (input: unknown) => T;
1259
-
1260
- /**
1261
- * @internal
1262
- */
1263
- export function createAssert<T>(): (input: unknown) => T {
1264
- halt("createAssert");
1265
- }
1266
- Object.assign(createAssert, assert);
1267
-
1268
- /**
1269
- * Creates a reusable {@link assertType} function.
1270
- *
1271
- * Duplicated function of {@link createAssert} for `typescript-is` users.
1272
- *
1273
- * @danger You have to specify the generic argument `T`
1274
- * @return Nothing until specifying the generic argument `T`
1275
- * @throws compile error
1276
- *
1277
- * @author Jeongho Nam - https://github.com/samchon
1278
- * @deprecated
1279
- */
1280
- export function createAssertType(): never;
1281
-
1282
- /**
1283
- * Creates a reusable {@link assertType} function.
1284
- *
1285
- * Duplicated function of {@link createAssert} for `typescript-is` users.
1286
- *
1287
- * @template T Type of the input value
1288
- * @returns A reusable `assert` function
1289
- *
1290
- * @author Jeongho Nam - https://github.com/samchon
1291
- * @deprecated
1292
- */
1293
- export function createAssertType<T>(): (input: unknown) => T;
1294
-
1295
- /**
1296
- * @internal
1297
- */
1298
- export function createAssertType<T>(): (input: unknown) => T {
1299
- halt("createAssertType");
1300
- }
1301
- Object.assign(createAssertType, assertType);
1302
-
1303
- /**
1304
- * Creates a reusable {@link is} function.
1305
- *
1306
- * @danger You have to specify the generic argument `T`
1307
- * @return Nothing until specifying the generic argument `T`
1308
- * @throws compile error
1309
- *
1310
- * @author Jeongho Nam - https://github.com/samchon
1311
- */
1312
- export function createIs(): never;
1313
-
1314
- /**
1315
- * Creates a reusable {@link is} function.
1316
- *
1317
- * @template T Type of the input value
1318
- * @returns A reusable `is` function
1319
- *
1320
- * @author Jeongho Nam - https://github.com/samchon
1321
- */
1322
- export function createIs<T>(): (input: unknown) => input is T;
1323
-
1324
- /**
1325
- * @internal
1326
- */
1327
- export function createIs<T>(): (input: unknown) => input is T {
1328
- halt("createIs");
1329
- }
1330
- Object.assign(createIs, is);
1331
-
1332
- /**
1333
- * Creates a reusable {@link validate} function.
1334
- *
1335
- * @danger You have to specify the generic argument `T`
1336
- * @return Nothing until specifying the generic argument `T`
1337
- * @throws compile error
1338
- *
1339
- * @author Jeongho Nam - https://github.com/samchon
1340
- */
1341
- export function createValidate(): never;
1342
-
1343
- /**
1344
- * Creates a reusable {@link validate} function.
1345
- *
1346
- * @template T Type of the input value
1347
- * @returns A reusable `validate` function
1348
- *
1349
- * @author Jeongho Nam - https://github.com/samchon
1350
- */
1351
- export function createValidate<T>(): (input: unknown) => IValidation<T>;
1352
-
1353
- /**
1354
- * @internal
1355
- */
1356
- export function createValidate(): (input: unknown) => IValidation {
1357
- halt("createValidate");
1358
- }
1359
- Object.assign(createValidate, validate);
1360
-
1361
- /* -----------------------------------------------------------
1362
- STRICT VALIDATORS
1363
- ----------------------------------------------------------- */
1364
- /**
1365
- * Creates a reusable {@link assertEquals} function.
1366
- *
1367
- * @danger You have to specify the generic argument `T`
1368
- * @return Nothing until specifying the generic argument `T`
1369
- * @throws compile error
1370
- *
1371
- * @author Jeongho Nam - https://github.com/samchon
1372
- */
1373
- export function createAssertEquals(): never;
1374
-
1375
- /**
1376
- * Creates a reusable {@link assertEquals} function.
1377
- *
1378
- * @template T Type of the input value
1379
- * @returns A reusable `assertEquals` function
1380
- *
1381
- * @author Jeongho Nam - https://github.com/samchon
1382
- */
1383
- export function createAssertEquals<T>(): (input: unknown) => T;
1384
-
1385
- /**
1386
- * @internal
1387
- */
1388
- export function createAssertEquals<T>(): (input: unknown) => T {
1389
- halt("createAssertEquals");
1390
- }
1391
- Object.assign(createAssertEquals, assertEquals);
1392
-
1393
- /**
1394
- * Creates a reusable {@link equals} function.
1395
- *
1396
- * @danger You have to specify the generic argument `T`
1397
- * @return Nothing until specifying the generic argument `T`
1398
- * @throws compile error
1399
- *
1400
- * @author Jeongho Nam - https://github.com/samchon
1401
- */
1402
- export function createEquals(): never;
1403
-
1404
- /**
1405
- * Creates a reusable {@link equals} function.
1406
- *
1407
- * @template T Type of the input value
1408
- * @returns A reusable `equals` function
1409
- *
1410
- * @author Jeongho Nam - https://github.com/samchon
1411
- */
1412
- export function createEquals<T>(): (input: unknown) => input is T;
1413
-
1414
- /**
1415
- * @internal
1416
- */
1417
- export function createEquals<T>(): (input: unknown) => input is T {
1418
- halt("createEquals");
1419
- }
1420
- Object.assign(createEquals, equals);
1421
-
1422
- /**
1423
- * Creates a reusable {@link validateEquals} function.
1424
- *
1425
- * @danger You have to specify the generic argument `T`
1426
- * @return Nothing until specifying the generic argument `T`
1427
- * @throws compile error
1428
- *
1429
- * @author Jeongho Nam - https://github.com/samchon
1430
- */
1431
- export function createValidateEquals(): never;
1432
-
1433
- /**
1434
- * Creates a reusable {@link validateEquals} function.
1435
- *
1436
- * @template T Type of the input value
1437
- * @returns A reusable `validateEquals` function
1438
- *
1439
- * @author Jeongho Nam - https://github.com/samchon
1440
- */
1441
- export function createValidateEquals<T>(): (input: unknown) => IValidation;
1442
-
1443
- /**
1444
- * @internal
1445
- */
1446
- export function createValidateEquals(): (input: unknown) => IValidation {
1447
- halt("createValidateEquals");
1448
- }
1449
- Object.assign(createValidateEquals, validateEquals);
1450
-
1451
- /* -----------------------------------------------------------
1452
- JSON FUNCTIONS
1453
- ----------------------------------------------------------- */
1454
- /**
1455
- * Creates a reusable {@link isParse} function.
1456
- *
1457
- * @danger You have to specify the generic argument `T`
1458
- * @return Nothing until specifying the generic argument `T`
1459
- * @throws compile error
1460
- *
1461
- * @author Jeongho Nam - https://github.com/samchon
1462
- */
1463
- export function createIsParse(): never;
1464
-
1465
- /**
1466
- * Creates a reusable {@link isParse} function.
1467
- *
1468
- * @template T Expected type of parsed value
1469
- * @returns A reusable `isParse` function
1470
- *
1471
- * @author Jeongho Nam - https://github.com/samchon
1472
- */
1473
- export function createIsParse<T>(): (input: string) => Primitive<T> | null;
1474
-
1475
- /**
1476
- * @internal
1477
- */
1478
- export function createIsParse<T>(): (input: string) => Primitive<T> | null {
1479
- halt("createIsParse");
1480
- }
1481
- Object.assign(createIsParse, isParse);
1482
-
1483
- /**
1484
- * Creates a reusable {@link assertParse} function.
1485
- *
1486
- * @danger You have to specify the generic argument `T`
1487
- * @return Nothing until specifying the generic argument `T`
1488
- * @throws compile error
1489
- *
1490
- * @author Jeongho Nam - https://github.com/samchon
1491
- */
1492
- export function createAssertParse(): never;
1493
-
1494
- /**
1495
- * Creates a reusable {@link assertParse} function.
1496
- *
1497
- * @template T Expected type of parsed value
1498
- * @returns A reusable `assertParse` function
1499
- *
1500
- * @author Jeongho Nam - https://github.com/samchon
1501
- */
1502
- export function createAssertParse<T>(): (input: string) => Primitive<T>;
1503
-
1504
- /**
1505
- * @internal
1506
- */
1507
- export function createAssertParse<T>(): (input: string) => Primitive<T> {
1508
- halt("createAssertParse");
1509
- }
1510
- Object.assign(createAssertParse, assertParse);
1511
-
1512
- /**
1513
- * Creates a reusable {@link validateParse} function.
1514
- *
1515
- * @danger You have to specify the generic argument `T`
1516
- * @return Nothing until specifying the generic argument `T`
1517
- * @throws compile error
1518
- *
1519
- * @author Jeongho Nam - https://github.com/samchon
1520
- */
1521
- export function createValidateParse(): never;
1522
-
1523
- /**
1524
- * Creates a reusable {@link validateParse} function.
1525
- *
1526
- * @template T Expected type of parsed value
1527
- * @returns A reusable `validateParse` function
1528
- *
1529
- * @author Jeongho Nam - https://github.com/samchon
1530
- */
1531
- export function createValidateParse<T>(): (
1532
- input: string,
1533
- ) => IValidation<Primitive<T>>;
1534
-
1535
- /**
1536
- * @internal
1537
- */
1538
- export function createValidateParse<T>(): (
1539
- input: string,
1540
- ) => IValidation<Primitive<T>> {
1541
- halt("createValidateParse");
1542
- }
1543
- Object.assign(createValidateParse, validateParse);
1544
-
1545
- /**
1546
- * Creates a reusable {@link stringify} function.
1547
- *
1548
- * @danger You have to specify the generic argument `T`
1549
- * @return Nothing until specifying the generic argument `T`
1550
- * @throws compile error
1551
- *
1552
- * @author Jeongho Nam - https://github.com/samchon
1553
- */
1554
- export function createStringify(): never;
1555
-
1556
- /**
1557
- * Creates a reusable {@link stringify} function.
1558
- *
1559
- * @template T Type of the input value
1560
- * @returns A reusable `stringify` function
1561
- *
1562
- * @author Jeongho Nam - https://github.com/samchon
1563
- */
1564
- export function createStringify<T>(): (input: T) => string;
1565
-
1566
- /**
1567
- * @internal
1568
- */
1569
- export function createStringify<T>(): (input: T) => string {
1570
- halt("createStringify");
1571
- }
1572
- Object.assign(createStringify, stringify);
1573
-
1574
- /**
1575
- * Creates a reusable {@link assertStringify} function.
1576
- *
1577
- * @danger You have to specify the generic argument `T`
1578
- * @return Nothing until specifying the generic argument `T`
1579
- * @throws compile error
1580
- *
1581
- * @author Jeongho Nam - https://github.com/samchon
1582
- */
1583
- export function createAssertStringify(): never;
1584
-
1585
- /**
1586
- * Creates a reusable {@link assertStringify} function.
1587
- *
1588
- * @template T Type of the input value
1589
- * @returns A reusable `assertStringify` function
1590
- *
1591
- * @author Jeongho Nam - https://github.com/samchon
1592
- */
1593
- export function createAssertStringify<T>(): (input: unknown) => string;
1594
-
1595
- /**
1596
- * @internal
1597
- */
1598
- export function createAssertStringify(): (input: unknown) => string {
1599
- halt("createAssertStringify");
1600
- }
1601
- Object.assign(createAssertStringify, assertStringify);
1602
-
1603
- /**
1604
- * Creates a reusable {@link isStringify} function.
1605
- *
1606
- * @danger You have to specify the generic argument `T`
1607
- * @return Nothing until specifying the generic argument `T`
1608
- * @throws compile error
1609
- *
1610
- * @author Jeongho Nam - https://github.com/samchon
1611
- */
1612
- export function createIsStringify(): never;
1613
-
1614
- /**
1615
- * Creates a reusable {@link isStringify} function.
1616
- *
1617
- * @template T Type of the input value
1618
- * @returns A reusable `isStringify` function
1619
- *
1620
- * @author Jeongho Nam - https://github.com/samchon
1621
- */
1622
- export function createIsStringify<T>(): (input: unknown) => string | null;
1623
-
1624
- /**
1625
- * @internal
1626
- */
1627
- export function createIsStringify(): (input: unknown) => string | null {
1628
- halt("createIsStringify");
1629
- }
1630
- Object.assign(createIsStringify, isStringify);
1631
-
1632
- /**
1633
- * Creates a reusable {@link validateStringify} function.
1634
- *
1635
- * @danger You have to specify the generic argument `T`
1636
- * @return Nothing until specifying the generic argument `T`
1637
- * @throws compile error
1638
- *
1639
- * @author Jeongho Nam - https://github.com/samchon
1640
- */
1641
- export function createValidateStringify(): never;
1642
-
1643
- /**
1644
- * Creates a reusable {@link validateStringify} function.
1645
- *
1646
- * @template T Type of the input value
1647
- * @returns A reusable `validateStringify` function
1648
-
1649
- * @author Jeongho Nam - https://github.com/samchon
1650
- */
1651
- export function createValidateStringify<T>(): (
1652
- input: unknown,
1653
- ) => IValidation<string>;
1654
-
1655
- /**
1656
- * @internal
1657
- */
1658
- export function createValidateStringify(): (
1659
- input: unknown,
1660
- ) => IValidation<string> {
1661
- halt("createValidateStringify");
1662
- }
1663
- Object.assign(createValidateStringify, validateStringify);
1664
-
1665
- /* -----------------------------------------------------------
1666
- MISCELLANEOUS
1667
- ----------------------------------------------------------- */
1668
- /**
1669
- * Creates a reusable {@link random} function.
1670
- *
1671
- * @danger You have to specify the generic argument `T`
1672
- * @param generator Random data generator
1673
- * @return Nothing until specifying the generic argument `T`
1674
- * @throws compile error
1675
- *
1676
- * @author Jeongho Nam - https://github.com/samchon
1677
- */
1678
- export function createRandom(generator?: Partial<IRandomGenerator>): never;
1679
-
1680
- /**
1681
- * Creates a resuable {@link random} function.
1682
- *
1683
- * @template T Type of the input value
1684
- * @param generator Random data generator
1685
- * @returns A reusable `random` function
1686
- *
1687
- * @author Jeongho Nam - https://github.com/samchon
1688
- */
1689
- export function createRandom<T>(
1690
- generator?: Partial<IRandomGenerator>,
1691
- ): () => Primitive<T>;
1692
-
1693
- /**
1694
- * @internal
1695
- */
1696
- export function createRandom(): never {
1697
- halt("createRandom");
1698
- }
1699
- Object.assign(createRandom, random);
1700
-
1701
- /**
1702
- * Creates a reusable {@link clone} function.
1703
- *
1704
- * @danger You have to specify the generic argument `T`
1705
- * @return Nothing until specifying the generic argument `T`
1706
- * @throws compile error
1707
- *
1708
- * @author Jeongho Nam - https://github.com/samchon
1709
- */
1710
- export function createClone(): never;
1711
-
1712
- /**
1713
- * Creates a resuable {@link clone} function.
1714
- *
1715
- * @template T Type of the input value
1716
- * @returns A reusable `clone` function
1717
- *
1718
- * @author Jeongho Nam - https://github.com/samchon
1719
- */
1720
- export function createClone<T>(): (input: T) => Primitive<T>;
1721
-
1722
- /**
1723
- * @internal
1724
- */
1725
- export function createClone(): never {
1726
- halt("createClone");
1727
- }
1728
- Object.assign(createClone, clone);
1729
-
1730
- /**
1731
- * Creates a reusable {@link assertClone} function.
1732
- *
1733
- * @danger You have to specify the generic argument `T`
1734
- * @return Nothing until specifying the generic argument `T`
1735
- * @throws compile error
1736
- *
1737
- * @author Jeongho Nam - https://github.com/samchon
1738
- */
1739
- export function createAssertClone(): never;
1740
-
1741
- /**
1742
- * Creates a resuable {@link assertClone} function.
1743
- *
1744
- * @template T Type of the input value
1745
- * @returns A reusable `clone` function
1746
- *
1747
- * @author Jeongho Nam - https://github.com/samchon
1748
- */
1749
- export function createAssertClone<T>(): (input: unknown) => Primitive<T>;
1750
-
1751
- /**
1752
- * @internal
1753
- */
1754
- export function createAssertClone(): never {
1755
- halt("createAssertClone");
1756
- }
1757
- Object.assign(createAssertClone, assertClone);
1758
-
1759
- /**
1760
- * Creates a reusable {@link isClone} function.
1761
- *
1762
- * @danger You have to specify the generic argument `T`
1763
- * @return Nothing until specifying the generic argument `T`
1764
- * @throws compile error
1765
- *
1766
- * @author Jeongho Nam - https://github.com/samchon
1767
- */
1768
- export function createIsClone(): never;
1769
-
1770
- /**
1771
- * Creates a resuable {@link isClone} function.
1772
- *
1773
- * @template T Type of the input value
1774
- * @returns A reusable `clone` function
1775
- *
1776
- * @author Jeongho Nam - https://github.com/samchon
1777
- */
1778
- export function createIsClone<T>(): (input: unknown) => Primitive<T> | null;
1779
-
1780
- /**
1781
- * @internal
1782
- */
1783
- export function createIsClone(): never {
1784
- halt("createIsClone");
1785
- }
1786
- Object.assign(createIsClone, isClone);
1787
-
1788
- /**
1789
- * Creates a reusable {@link validateClone} function.
1790
- *
1791
- * @danger You have to specify the generic argument `T`
1792
- * @return Nothing until specifying the generic argument `T`
1793
- * @throws compile error
1794
- *
1795
- * @author Jeongho Nam - https://github.com/samchon
1796
- */
1797
- export function createValidateClone(): never;
1798
-
1799
- /**
1800
- * Creates a resuable {@link validateClone} function.
1801
- *
1802
- * @template T Type of the input value
1803
- * @returns A reusable `clone` function
1804
- *
1805
- * @author Jeongho Nam - https://github.com/samchon
1806
- */
1807
- export function createValidateClone<T>(): (
1808
- input: unknown,
1809
- ) => IValidation<Primitive<T>>;
1810
-
1811
- /**
1812
- * @internal
1813
- */
1814
- export function createValidateClone(): never {
1815
- halt("createValidateClone");
1816
- }
1817
- Object.assign(createValidateClone, validateClone);
1818
-
1819
- /**
1820
- * Creates a reusable {@link prune} function.
1821
- *
1822
- * @danger You have to specify the generic argument `T`
1823
- * @return Nothing until specifying the generic argument `T`
1824
- * @throws compile error
1825
- *
1826
- * @author Jeongho Nam - https://github.com/samchon
1827
- */
1828
- export function createPrune(): never;
1829
-
1830
- /**
1831
- * Creates a resuable {@link prune} function.
1832
- *
1833
- * @template T Type of the input value
1834
- * @returns A reusable `prune` function
1835
- *
1836
- * @author Jeongho Nam - https://github.com/samchon
1837
- */
1838
- export function createPrune<T extends object>(): (input: T) => void;
1839
-
1840
- /**
1841
- * @internal
1842
- */
1843
- export function createPrune<T extends object>(): (input: T) => void {
1844
- halt("createPrune");
1845
- }
1846
- Object.assign(createPrune, prune);
1847
-
1848
- /**
1849
- * Creates a reusable {@link isPrune} function.
1850
- *
1851
- * @danger You have to specify the generic argument `T`
1852
- * @return Nothing until specifying the generic argument `T`
1853
- * @throws compile error
1854
- *
1855
- * @author Jeongho Nam - https://github.com/samchon
1856
- */
1857
- export function createAssertPrune(): never;
1858
-
1859
- /**
1860
- * Creates a resuable {@link isPrune} function.
1861
- *
1862
- * @template T Type of the input value
1863
- * @returns A reusable `isPrune` function
1864
- *
1865
- * @author Jeongho Nam - https://github.com/samchon
1866
- */
1867
- export function createAssertPrune<T extends object>(): (input: T) => T;
1868
-
1869
- /**
1870
- * @internal
1871
- */
1872
- export function createAssertPrune<T extends object>(): (input: T) => T {
1873
- halt("createAssertPrune");
1874
- }
1875
- Object.assign(createAssertPrune, assertPrune);
1876
-
1877
- /**
1878
- * Creates a reusable {@link isPrune} function.
1879
- *
1880
- * @danger You have to specify the generic argument `T`
1881
- * @return Nothing until specifying the generic argument `T`
1882
- * @throws compile error
1883
- *
1884
- * @author Jeongho Nam - https://github.com/samchon
1885
- */
1886
- export function createIsPrune(): never;
1887
-
1888
- /**
1889
- * Creates a resuable {@link isPrune} function.
1890
- *
1891
- * @template T Type of the input value
1892
- * @returns A reusable `isPrune` function
1893
- *
1894
- * @author Jeongho Nam - https://github.com/samchon
1895
- */
1896
- export function createIsPrune<T extends object>(): (input: T) => input is T;
1897
-
1898
- /**
1899
- * @internal
1900
- */
1901
- export function createIsPrune<T extends object>(): (input: T) => input is T {
1902
- halt("createIsPrune");
1903
- }
1904
- Object.assign(createIsPrune, isPrune);
1905
-
1906
- /**
1907
- * Creates a reusable {@link validatePrune} function.
1908
- *
1909
- * @danger You have to specify the generic argument `T`
1910
- * @return Nothing until specifying the generic argument `T`
1911
- * @throws compile error
1912
- *
1913
- * @author Jeongho Nam - https://github.com/samchon
1914
- */
1915
- export function createValidatePrune(): never;
1916
-
1917
- /**
1918
- * Creates a resuable {@link validatePrune} function.
1919
- *
1920
- * @template T Type of the input value
1921
- * @returns A reusable `validatePrune` function
1922
- *
1923
- * @author Jeongho Nam - https://github.com/samchon
1924
- */
1925
- export function createValidatePrune<T extends object>(): (
1926
- input: T,
1927
- ) => IValidation<T>;
1928
-
1929
- /**
1930
- * @internal
1931
- */
1932
- export function createValidatePrune<T extends object>(): (
1933
- input: T,
1934
- ) => IValidation<T> {
1935
- halt("createValidatePrune");
1936
- }
1937
- Object.assign(createValidatePrune, validatePrune);
1938
-
1939
- /**
1940
- * @internal
1941
- */
1942
- function halt(name: string): never {
1943
- throw new Error(
1944
- `Error on typia.${name}(): no transform has been configured. Configure the "tsconfig.json" file following the [README.md#setup](https://github.com/samchon/typia#setup)`,
1945
- );
1946
- }
1
+ import { Namespace } from "./functional/Namespace";
2
+
3
+ import { IMetadataApplication } from "./metadata/IMetadataApplication";
4
+ import { IJsonApplication } from "./schemas/IJsonApplication";
5
+
6
+ import { IRandomGenerator } from "./IRandomGenerator";
7
+ import { IValidation } from "./IValidation";
8
+ import { Primitive } from "./Primitive";
9
+ import { TypeGuardError } from "./TypeGuardError";
10
+
11
+ export * from "./schemas/IJsonApplication";
12
+ export * from "./schemas/IJsonComponents";
13
+ export * from "./schemas/IJsonSchema";
14
+ export * from "./IRandomGenerator";
15
+ export * from "./IValidation";
16
+ export * from "./Primitive";
17
+ export * from "./TypeGuardError";
18
+
19
+ /* ===========================================================
20
+ SINGLE FUNCTIONS
21
+ - BASIC VALIDATORS
22
+ - STRICT VALIDATORS
23
+ - JSON FUNCTIONS
24
+ - MISCELLANEOUS
25
+ ==============================================================
26
+ BASIC VALIDATORS
27
+ ----------------------------------------------------------- */
28
+ /**
29
+ * Asserts a value type.
30
+ *
31
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
32
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
33
+ * value is following the type `T`, just input parameter would be returned.
34
+ *
35
+ * If what you want is not asserting but just knowing whether the parametric value is
36
+ * following the type `T` or not, you can choose the {@link is} function instead.
37
+ * Otherwise you want to know all the errors, {@link validate} is the way to go.
38
+ *
39
+ * On the other and, if you don't want to allow any superfluous property that is not
40
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
41
+ *
42
+ * @template T Type of the input value
43
+ * @param input A value to be asserted
44
+ * @returns Parametric input value
45
+ * @throws A {@link TypeGuardError} instance with detailed reason
46
+ *
47
+ * @author Jeongho Nam - https://github.com/samchon
48
+ */
49
+ export function assert<T>(input: T): T;
50
+
51
+ /**
52
+ * Asserts a value type.
53
+ *
54
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
55
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
56
+ * value is following the type `T`, just input parameter would be returned.
57
+ *
58
+ * If what you want is not asserting but just knowing whether the parametric value is
59
+ * following the type `T` or not, you can choose the {@link is} function instead.
60
+ * Otherwise, you want to know all the errors, {@link validate} is the way to go.
61
+ *
62
+ * On the other and, if you don't want to allow any superfluous property that is not
63
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
64
+ *
65
+ * @template T Type of the input value
66
+ * @param input A value to be asserted
67
+ * @returns Parametric input value casted as `T`
68
+ * @throws A {@link TypeGuardError} instance with detailed reason
69
+ *
70
+ * @author Jeongho Nam - https://github.com/samchon
71
+ */
72
+ export function assert<T>(input: unknown): T;
73
+
74
+ /**
75
+ * @internal
76
+ */
77
+ export function assert(): never {
78
+ halt("assert");
79
+ }
80
+ Object.assign(assert, Namespace.assert("assert"));
81
+
82
+ /**
83
+ * Asserts a value type.
84
+ *
85
+ * Duplicated function of {@link assert} for `typescript-is` users.
86
+ *
87
+ * @template T Type of the input value
88
+ * @param input A value to be asserted
89
+ * @returns Parametric input value
90
+ * @throws A {@link TypeGuardError} instance with detailed reason
91
+ *
92
+ * @author Jeongho Nam - https://github.com/samchon
93
+ * @deprecated
94
+ */
95
+ export function assertType<T>(input: T): T;
96
+
97
+ /**
98
+ * Asserts a value type.
99
+ *
100
+ * Duplicated function of {@link assert} for `typescript-is` users.
101
+ *
102
+ * @template T Type of the input value
103
+ * @param input A value to be asserted
104
+ * @returns Parametric input value
105
+ * @throws A {@link TypeGuardError} instance with detailed reason
106
+ *
107
+ * @author Jeongho Nam - https://github.com/samchon
108
+ * @deprecated
109
+ */
110
+ export function assertType<T>(input: unknown): T;
111
+
112
+ /**
113
+ * @internal
114
+ */
115
+ export function assertType(): never {
116
+ halt("assertType");
117
+ }
118
+ Object.assign(assertType, Namespace.assert("assertType"));
119
+
120
+ /**
121
+ * Tests a value type.
122
+ *
123
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
124
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
125
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
126
+ * returned.
127
+ *
128
+ * If what you want is not just knowing whether the parametric value is following the
129
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
130
+ * {@link assert} function instead. Also, if you want to know all the errors with
131
+ * detailed reasons, {@link validate} function would be useful.
132
+ *
133
+ * On the other and, if you don't want to allow any superfluous property that is not
134
+ * enrolled to the type `T`, you can use {@link equals} function instead.
135
+ *
136
+ * @template T Type of the input value
137
+ * @param input A value to be tested
138
+ * @returns Whether the parametric value is following the type `T` or not
139
+ *
140
+ * @author Jeongho Nam - https://github.com/samchon
141
+ */
142
+ export function is<T>(input: T): input is T;
143
+
144
+ /**
145
+ * Tests a value type.
146
+ *
147
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
148
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
149
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
150
+ * returned.
151
+ *
152
+ * If what you want is not just knowing whether the parametric value is following the
153
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
154
+ * {@link assert} function instead. Also, if you want to know all the errors with
155
+ * detailed reasons, {@link validate} function would be useful.
156
+ *
157
+ * On the other and, if you don't want to allow any superfluous property that is not
158
+ * enrolled to the type `T`, you can use {@link equals} function instead.
159
+ *
160
+ * @template T Type of the input value
161
+ * @param input A value to be tested
162
+ * @returns Whether the parametric value is following the type `T` or not
163
+ *
164
+ * @author Jeongho Nam - https://github.com/samchon
165
+ */
166
+ export function is<T>(input: unknown): input is T;
167
+
168
+ /**
169
+ * @internal
170
+ */
171
+ export function is(): never {
172
+ halt("is");
173
+ }
174
+ Object.assign(is, Namespace.assert("is"));
175
+
176
+ /**
177
+ * Validates a value type.
178
+ *
179
+ * Validates a parametric value type and archives all the type errors into an
180
+ * {@link IValidation.errors} array, if the parametric value is not following the
181
+ * type `T`. Of course, if the parametric value is following the type `T`, the
182
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
183
+ * would have the `true` value.
184
+ *
185
+ * If what you want is not finding all the error, but asserting the parametric value
186
+ * type with exception throwing, you can choose {@link assert} function instead.
187
+ * Otherwise, you just want to know whether the parametric value is matched with the
188
+ * type `T`, {@link is} function is the way to go.
189
+ *
190
+ * On the other and, if you don't want to allow any superfluous property that is not
191
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
192
+ *
193
+ * @template Type of the input value
194
+ * @param input A value to be validated
195
+ * @returns Validation result
196
+ *
197
+ * @author Jeongho Nam - https://github.com/samchon
198
+ */
199
+ export function validate<T>(input: T): IValidation<T>;
200
+
201
+ /**
202
+ * Validates a value type.
203
+ *
204
+ * Validates a parametric value type and archives all the type errors into an
205
+ * {@link IValidation.errors} array, if the parametric value is not following the
206
+ * type `T`. Of course, if the parametric value is following the type `T`, the
207
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
208
+ * would have the `true` value.
209
+ *
210
+ * If what you want is not finding all the error, but asserting the parametric value
211
+ * type with exception throwing, you can choose {@link assert} function instead.
212
+ * Otherwise, you just want to know whether the parametric value is matched with the
213
+ * type `T`, {@link is} function is the way to go.
214
+ *
215
+ * On the other and, if you don't want to allow any superfluous property that is not
216
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
217
+ *
218
+ * @template Type of the input value
219
+ * @param input A value to be validated
220
+ * @returns Validation result
221
+ *
222
+ * @author Jeongho Nam - https://github.com/samchon
223
+ */
224
+ export function validate<T>(input: unknown): IValidation<T>;
225
+
226
+ /**
227
+ * @internal
228
+ */
229
+ export function validate(): never {
230
+ halt("validate");
231
+ }
232
+ Object.assign(validate, Namespace.validate());
233
+
234
+ /* -----------------------------------------------------------
235
+ STRICT VALIDATORS
236
+ ----------------------------------------------------------- */
237
+ /**
238
+ * Asserts equality between a value and its type.
239
+ *
240
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
241
+ * reason, if the parametric value is not following the type `T` or some superfluous
242
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
243
+ * following the type `T` without any superfluous property, just input parameter would
244
+ * be returned.
245
+ *
246
+ * If what you want is not asserting but just knowing whether the parametric value is
247
+ * following the type `T` or not, you can choose the {@link equals} function instead.
248
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
249
+ *
250
+ * On the other hand, if you want to allow superfluous property that is not enrolled
251
+ * to the type `T`, you can use {@link assert} function instead.
252
+ *
253
+ * @template T Type of the input value
254
+ * @param input A value to be asserted
255
+ * @returns Parametric input value
256
+ * @throws A {@link TypeGuardError} instance with detailed reason
257
+ *
258
+ * @author Jeongho Nam - https://github.com/samchon
259
+ */
260
+ export function assertEquals<T>(input: T): T;
261
+
262
+ /**
263
+ * Asserts equality between a value and its type.
264
+ *
265
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
266
+ * reason, if the parametric value is not following the type `T` or some superfluous
267
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
268
+ * following the type `T` without any superfluous property, just input parameter would
269
+ * be returned.
270
+ *
271
+ * If what you want is not asserting but just knowing whether the parametric value is
272
+ * following the type `T` or not, you can choose the {@link equals} function instead.
273
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
274
+ *
275
+ * On the other hand, if you want to allow superfluous property that is not enrolled
276
+ * to the type `T`, you can use {@link assert} function instead.
277
+ *
278
+ * @template T Type of the input value
279
+ * @param input A value to be asserted
280
+ * @returns Parametric input value casted as `T`
281
+ * @throws A {@link TypeGuardError} instance with detailed reason
282
+ *
283
+ * @author Jeongho Nam - https://github.com/samchon
284
+ */
285
+ export function assertEquals<T>(input: unknown): T;
286
+
287
+ /**
288
+ * @internal
289
+ */
290
+ export function assertEquals(): never {
291
+ halt("assertEquals");
292
+ }
293
+ Object.assign(assertEquals, Namespace.assert("assertEquals"));
294
+
295
+ /**
296
+ * Tests equality between a value and its type.
297
+ *
298
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
299
+ * or not. If the parametric value is matched with the type `T` and there's not any
300
+ * superfluous property that is not listed on the type `T`, `true` value would be
301
+ * returned. Otherwise, the parametric value is not following the type `T` or some
302
+ * superfluous property exists, `false` value would be returned.
303
+ *
304
+ * If what you want is not just knowing whether the parametric value is following the
305
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
306
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
307
+ * detailed reasons, {@link validateEquals} function would be useful.
308
+ *
309
+ * On the other hand, if you want to allow superfluous property that is not enrolled
310
+ * to the type `T`, you can use {@link is} function instead.
311
+ *
312
+ * @template T Type of the input value
313
+ * @param input A value to be tested
314
+ * @returns Whether the parametric value is equivalent to the type `T` or not
315
+ *
316
+ * @author Jeongho Nam - https://github.com/samchon
317
+ */
318
+ export function equals<T>(input: T): input is T;
319
+
320
+ /**
321
+ * Tests equality between a value and its type.
322
+ *
323
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
324
+ * or not. If the parametric value is matched with the type `T` and there's not any
325
+ * superfluous property that is not listed on the type `T`, `true` value would be
326
+ * returned. Otherwise, the parametric value is not following the type `T` or some
327
+ * superfluous property exists, `false` value would be returned.
328
+ *
329
+ * If what you want is not just knowing whether the parametric value is following the
330
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
331
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
332
+ * detailed reasons, {@link validateEquals} function would be useful.
333
+ *
334
+ * On the other hand, if you want to allow superfluous property that is not enrolled
335
+ * to the type `T`, you can use {@link is} function instead.
336
+ *
337
+ * @template T Type of the input value
338
+ * @param input A value to be tested
339
+ * @returns Whether the parametric value is equivalent to the type `T` or not
340
+ *
341
+ * @author Jeongho Nam - https://github.com/samchon
342
+ */
343
+ export function equals<T>(input: unknown): input is T;
344
+
345
+ /**
346
+ * @internal
347
+ */
348
+ export function equals(): never {
349
+ halt("equals");
350
+ }
351
+ Object.assign(equals, Namespace.is());
352
+
353
+ /**
354
+ * Validates equality between a value and its type.
355
+ *
356
+ * Validates a parametric value type and archives all the type errors into an
357
+ * {@link IValidation.errors} array, if the parametric value is not following the
358
+ * type `T` or some superfluous property that is not listed on the type `T` has been
359
+ * found. Of course, if the parametric value is following the type `T` and no
360
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
361
+ * and {@link IValidation.success} would have the `true` value.
362
+ *
363
+ * If what you want is not finding all the error, but asserting the parametric value
364
+ * type with exception throwing, you can choose {@link assert} function instead.
365
+ * Otherwise, you just want to know whether the parametric value is matched with the
366
+ * type `T`, {@link is} function is the way to go.
367
+ *
368
+ * On the other and, if you don't want to allow any superfluous property that is not
369
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
370
+ *
371
+ * @template Type of the input value
372
+ * @param input A value to be validated
373
+ * @returns Validation result
374
+ *
375
+ * @author Jeongho Nam - https://github.com/samchon
376
+ */
377
+ export function validateEquals<T>(input: T): IValidation<T>;
378
+
379
+ /**
380
+ * Validates equality between a value and its type.
381
+ *
382
+ * Validates a parametric value type and archives all the type errors into an
383
+ * {@link IValidation.errors} array, if the parametric value is not following the
384
+ * type `T` or some superfluous property that is not listed on the type `T` has been
385
+ * found. Of course, if the parametric value is following the type `T` and no
386
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
387
+ * and {@link IValidation.success} would have the `true` value.
388
+ *
389
+ * If what you want is not finding all the error, but asserting the parametric value
390
+ * type with exception throwing, you can choose {@link assert} function instead.
391
+ * Otherwise, you just want to know whether the parametric value is matched with the
392
+ * type `T`, {@link is} function is the way to go.
393
+ *
394
+ * On the other and, if you don't want to allow any superfluous property that is not
395
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
396
+ *
397
+ * @template Type of the input value
398
+ * @param input A value to be validated
399
+ * @returns Validation result
400
+ *
401
+ * @author Jeongho Nam - https://github.com/samchon
402
+ */
403
+ export function validateEquals<T>(input: unknown): IValidation<T>;
404
+
405
+ /**
406
+ * @internal
407
+ */
408
+ export function validateEquals(): never {
409
+ halt("validateEquals");
410
+ }
411
+ Object.assign(validateEquals, Namespace.validate());
412
+
413
+ /* -----------------------------------------------------------
414
+ JSON FUNCTIONS
415
+ ----------------------------------------------------------- */
416
+ /**
417
+ * > You must configure the generic argument `T`.
418
+ *
419
+ * JSON Schema Application.
420
+ *
421
+ * Creates a JSON schema application which contains both main JSON schemas and components.
422
+ * Note that, all of the object types are stored in the {@link IJsonApplication.components}
423
+ * property for the `$ref` referencing.
424
+ *
425
+ * Also, `typia.application()` has additional generic arguments, *Purpose*.
426
+ * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
427
+ * you should configure the *Purpose* appropriately.
428
+ *
429
+ * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
430
+ * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
431
+ * the tuple definition.
432
+ *
433
+ * @template Types Tuple of target types
434
+ * @template Purpose Purpose of the JSON schema`
435
+ * @template Prefix Prefix of the JSON components referenced by `$ref` tag
436
+ * @return JSON schema application
437
+ *
438
+ * @author Jeongho Nam - https://github.com/samchon
439
+ */
440
+ export function application(): never;
441
+
442
+ /**
443
+ * JSON Schema Application.
444
+ *
445
+ * Creates a JSON schema application which contains both main JSON schemas and components.
446
+ * Note that, all of the object types are stored in the {@link IJsonApplication.components}
447
+ * property for the `$ref` referencing.
448
+ *
449
+ * Also, `typia.application()` has additional generic arguments, *Purpose*.
450
+ * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
451
+ * you should configure the *Purpose* appropriately.
452
+ *
453
+ * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
454
+ * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
455
+ * the tuple definition.
456
+ *
457
+ * @template Types Tuple of target types
458
+ * @template Purpose Purpose of the JSON schema
459
+ * @template Prefix Prefix of the JSON components referenced by `$ref` tag
460
+ * @return JSON schema application
461
+ *
462
+ * @author Jeongho Nam - https://github.com/samchon
463
+ */
464
+ export function application<
465
+ Types extends unknown[],
466
+ Purpose extends "swagger" | "ajv" = "swagger",
467
+ Prefix extends string = Purpose extends "swagger"
468
+ ? "#/components/schemas"
469
+ : "components#/schemas",
470
+ >(): IJsonApplication;
471
+
472
+ /**
473
+ * @internal
474
+ */
475
+ export function application(): never {
476
+ halt("application");
477
+ }
478
+
479
+ /**
480
+ * > You must configure the generic argument `T`.
481
+ *
482
+ * Safe `JSON.parse()` function with type assertion.
483
+ *
484
+ * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
485
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
486
+ * instance with type assertion.
487
+ *
488
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
489
+ * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
490
+ * the parsed value would be returned.
491
+ *
492
+ * @template T Expected type of parsed value
493
+ * @param input JSON string
494
+ * @returns Parsed value
495
+ *
496
+ * @author Jeongho Nam - https://github.com/samchon
497
+ */
498
+ export function assertParse(input: string): never;
499
+
500
+ /**
501
+ * Safe `JSON.parse()` function with type assertion.
502
+ *
503
+ * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
504
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
505
+ * instance with type assertion.
506
+ *
507
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
508
+ * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
509
+ * the parsed value would be returned.
510
+ *
511
+ * @template T Expected type of parsed value
512
+ * @param input JSON string
513
+ * @returns Parsed value
514
+ *
515
+ * @author Jeongho Nam - https://github.com/samchon
516
+ */
517
+ export function assertParse<T>(input: string): T;
518
+
519
+ /**
520
+ * @internal
521
+ */
522
+ export function assertParse<T>(): T {
523
+ halt("assertParse");
524
+ }
525
+ Object.assign(assertParse, Namespace.assert("assertParse"));
526
+
527
+ /**
528
+ * > You must configure the generic argument `T`.
529
+ *
530
+ * Safe `JSON.parse()` function with type checking.
531
+ *
532
+ * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
533
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
534
+ * instance with type checking.
535
+ *
536
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
537
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
538
+ * value would be returned.
539
+ *
540
+ * @template T Expected type of parsed value
541
+ * @param input JSON string
542
+ * @returns Parsed value when exact type, otherwise `null`
543
+ *
544
+ * @author Jeongho Nam - https://github.com/samchon
545
+ */
546
+ export function isParse(input: string): never;
547
+
548
+ /**
549
+ * Safe `JSON.parse()` function with type checking.
550
+ *
551
+ * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
552
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
553
+ * instance with type checking.
554
+ *
555
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
556
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
557
+ * value would be returned.
558
+ *
559
+ * @template T Expected type of parsed value
560
+ * @param input JSON string
561
+ * @returns Parsed value when exact type, otherwise `null`
562
+ *
563
+ * @author Jeongho Nam - https://github.com/samchon
564
+ */
565
+ export function isParse<T>(input: string): T | null;
566
+
567
+ /**
568
+ * @internal
569
+ */
570
+ export function isParse<T>(): T | null {
571
+ halt("isParse");
572
+ }
573
+ Object.assign(isParse, is);
574
+
575
+ /**
576
+ * > You must configure the generic argument `T`.
577
+ *
578
+ * Safe `JSON.parse()` function with detailed type validation.
579
+ *
580
+ * `typia.validateParse()` is a combination function of `JSON.parse()` and
581
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
582
+ * to a `T` typed instance with detailed type validation.
583
+ *
584
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
585
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
586
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
587
+ * property of the output {@link IValidation.ISuccess} instance.
588
+ *
589
+ * @template T Expected type of parsed value
590
+ * @param input JSON string
591
+ * @returns Validation result with JSON parsed value
592
+ *
593
+ * @author Jeongho Nam - https://github.com/samchon
594
+ */
595
+ export function validateParse(input: string): never;
596
+
597
+ /**
598
+ * Safe `JSON.parse()` function with detailed type validation.
599
+ *
600
+ * `typia.validateParse()` is a combination function of `JSON.parse()` and
601
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
602
+ * to a `T` typed instance with detailed type validation.
603
+ *
604
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
605
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
606
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
607
+ * property of the output {@link IValidation.ISuccess} instance.
608
+ *
609
+ * @template T Expected type of parsed value
610
+ * @param input JSON string
611
+ * @returns Validation result with JSON parsed value
612
+ *
613
+ * @author Jeongho Nam - https://github.com/samchon
614
+ */
615
+ export function validateParse<T>(input: string): IValidation<T>;
616
+
617
+ /**
618
+ * @internal
619
+ */
620
+ export function validateParse<T>(): IValidation<T> {
621
+ halt("validateParse");
622
+ }
623
+ Object.assign(validateParse, validate);
624
+
625
+ /**
626
+ * 8x faster `JSON.stringify()` function.
627
+ *
628
+ * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x faster
629
+ * than the native `JSON.stringify()` function. The 5x faster principle is because
630
+ * it writes an optimized JSON conversion plan, only for the type `T`.
631
+ *
632
+ * For reference, this `typia.stringify()` does not validate the input value type.
633
+ * It just believes that the input value is following the type `T`. Therefore, if you
634
+ * can't ensure the input value type, it would be better to call one of below functions
635
+ * instead.
636
+ *
637
+ * - {@link assertStringify}
638
+ * - {@link isStringify}
639
+ * - {@link validateStringify}
640
+ *
641
+ * @template T Type of the input value
642
+ * @param input A value to be converted
643
+ * @return JSON string value
644
+ *
645
+ * @author Jeongho Nam - https://github.com/samchon
646
+ */
647
+ export function stringify<T>(input: T): string;
648
+
649
+ /**
650
+ * @internal
651
+ */
652
+ export function stringify(): never {
653
+ halt("stringify");
654
+ }
655
+ Object.assign(stringify, Namespace.stringify("stringify"));
656
+
657
+ /**
658
+ * 5x faster `JSON.stringify()` function with type assertion.
659
+ *
660
+ * `typia.assertStringify()` is a combination function of {@link assert} and
661
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
662
+ * Notation) string, with type assertion.
663
+ *
664
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
665
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
666
+ * string would be returned.
667
+ *
668
+ * For reference, with type assertion, it is even 5x times faster than the native
669
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
670
+ * with confidence.
671
+ *
672
+ * @template T Type of the input value
673
+ * @param input A value to be asserted and converted
674
+ * @return JSON string value
675
+ *
676
+ * @author Jeongho Nam - https://github.com/samchon
677
+ */
678
+ export function assertStringify<T>(input: T): string;
679
+
680
+ /**
681
+ * 5x faster `JSON.stringify()` function with type assertion.
682
+ *
683
+ * `typia.assertStringify()` is a combination function of {@link assert} and
684
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
685
+ * Notation) string, with type assertion.
686
+ *
687
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
688
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
689
+ * string would be returned.
690
+ *
691
+ * For reference, with type assertion, it is even 5x times faster than the native
692
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
693
+ * with confidence.
694
+ *
695
+ * @template T Type of the input value
696
+ * @param input A value to be asserted and converted
697
+ * @return JSON string value
698
+ *
699
+ * @author Jeongho Nam - https://github.com/samchon
700
+ */
701
+ export function assertStringify<T>(input: T): unknown;
702
+
703
+ /**
704
+ * @internal
705
+ */
706
+ export function assertStringify(): string {
707
+ halt("assertStringify");
708
+ }
709
+ Object.assign(assertStringify, Namespace.assert("assertStringify"));
710
+ Object.assign(assertStringify, Namespace.stringify("assertStringify"));
711
+
712
+ /**
713
+ * 7x faster `JSON.stringify()` function with type checking.
714
+ *
715
+ * `typia.stringify()` is a combination function of {@link is} and
716
+ * {@link stringify}. Therefore, it converts an input value to JSON
717
+ * (JavaScript Object Notation) string, with type checking.
718
+ *
719
+ * In such reason, when `input` value is not matched with the type `T`, it returns
720
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
721
+ * be returned.
722
+ *
723
+ * For reference, with type checking, it is even 7x times faster than the native
724
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
725
+ * with confidence.
726
+ *
727
+ * @template T Type of the input value
728
+ * @param input A value to be checked and converted
729
+ * @return JSON string value when exact type, otherwise null
730
+ *
731
+ * @author Jeongho Nam - https://github.com/samchon
732
+ */
733
+ export function isStringify<T>(input: T): string | null;
734
+
735
+ /**
736
+ * 7x faster `JSON.stringify()` function with type checking.
737
+ *
738
+ * `typia.isStringify()` is a combination function of {@link is} and
739
+ * {@link stringify}. Therefore, it converts an input value to JSON
740
+ * (JavaScript Object Notation) string, with type checking.
741
+ *f
742
+ * In such reason, when `input` value is not matched with the type `T`, it returns
743
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
744
+ * be returned.
745
+ *
746
+ * For reference, with type checking, it is even 7x times faster than the native
747
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
748
+ * with confidence.
749
+ *
750
+ * @template T Type of the input value
751
+ * @param input A value to be checked and converted
752
+ * @return JSON string value when exact type, otherwise null
753
+ *
754
+ * @author Jeongho Nam - https://github.com/samchon
755
+ */
756
+ export function isStringify<T>(input: unknown): string | null;
757
+
758
+ /**
759
+ * @internal
760
+ */
761
+ export function isStringify(): string | null {
762
+ halt("isStringify");
763
+ }
764
+
765
+ Object.assign(isStringify, Namespace.is());
766
+ Object.assign(isStringify, Namespace.stringify("isStringify"));
767
+
768
+ /**
769
+ * 5x faster `JSON.stringify()` function with detailed type validation.
770
+ *
771
+ * `typia.validateStringify()` is a combination function of {@link validate} and
772
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
773
+ * Notation) string, with detailed type validation.
774
+ *
775
+ * In such reason, when `input` value is not matched with the type `T`, it returns
776
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
777
+ * problem on the `input` value, JSON string would be stored in `data` property of
778
+ * the output {@link IValidation.ISuccess} instance.
779
+ *
780
+ * For reference, with detailed type validation, it is even 5x times faster than the
781
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
782
+ * with confidence.
783
+ *
784
+ * @template T Type of the input value
785
+ * @param input A value to be checked and converted
786
+ * @returns Validation result with JSON string value
787
+ *
788
+ * @author Jeongho Nam - https://github.com/samchon
789
+ */
790
+ export function validateStringify<T>(input: T): IValidation<string>;
791
+
792
+ /**
793
+ * 5x faster `JSON.stringify()` function with detailed type validation.
794
+ *
795
+ * `typia.validateStringify()` is a combination function of {@link validate} and
796
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
797
+ * Notation) string, with detailed type validation.
798
+ *
799
+ * In such reason, when `input` value is not matched with the type `T`, it returns
800
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
801
+ * problem on the `input` value, JSON string would be stored in `data` property of
802
+ * the output {@link IValidation.ISuccess} instance.
803
+ *
804
+ * For reference, with detailed type validation, it is even 5x times faster than the
805
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
806
+ * with confidence.
807
+ *
808
+ * @template T Type of the input value
809
+ * @param input A value to be checked and converted
810
+ * @returns Validation result with JSON string value
811
+ *
812
+ * @author Jeongho Nam - https://github.com/samchon
813
+ */
814
+ export function validateStringify<T>(input: unknown): IValidation<string>;
815
+
816
+ /**
817
+ * @internal
818
+ */
819
+ export function validateStringify(): IValidation<string> {
820
+ halt("validateStringify");
821
+ }
822
+ Object.assign(validateStringify, Namespace.validate());
823
+ Object.assign(validateStringify, Namespace.stringify("validateStringify"));
824
+
825
+ /* -----------------------------------------------------------
826
+ MISCELLANEOUS
827
+ ----------------------------------------------------------- */
828
+ /**
829
+ * @internal
830
+ */
831
+ export function metadata(): never;
832
+
833
+ /**
834
+ * @internal
835
+ */
836
+ export function metadata<Types extends unknown[]>(): IMetadataApplication;
837
+
838
+ /**
839
+ * @internal
840
+ */
841
+ export function metadata(): never {
842
+ halt("metadata");
843
+ }
844
+
845
+ /**
846
+ * > You must configure the generic argument `T`.
847
+ *
848
+ * Generate random data.
849
+ *
850
+ * Generates a random data following type the `T`.
851
+ *
852
+ * For reference, this `typia.random()` function generates only primitive type.
853
+ * If there're some methods in the type `T` or its nested instances, those would
854
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
855
+ * would be generated instead.
856
+ *
857
+ * @template T Type of data to generate
858
+ * @param generator Random data generator
859
+ * @return Randomly generated data
860
+ *
861
+ * @author Jeongho Nam - https://github.com/samchon
862
+ */
863
+ export function random(generator?: Partial<IRandomGenerator>): never;
864
+
865
+ /**
866
+ * Generate random data.
867
+ *
868
+ * Generates a random data following type the `T`.
869
+ *
870
+ * For reference, this `typia.random()` function generates only primitive type.
871
+ * If there're some methods in the type `T` or its nested instances, those would
872
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
873
+ * would be generated instead.
874
+ *
875
+ * @template T Type of data to generate
876
+ * @param generator Random data generator
877
+ * @return Randomly generated data
878
+ *
879
+ * @author Jeongho Nam - https://github.com/samchon
880
+ */
881
+ export function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
882
+
883
+ /**
884
+ * @internal
885
+ */
886
+ export function random(): never {
887
+ halt("random");
888
+ }
889
+ Object.assign(random, Namespace.random());
890
+
891
+ /**
892
+ * Clone a data.
893
+ *
894
+ * Clones an instance following type `T`. If the target *input* value or its member
895
+ * variable contains a class instance that is having a `toJSON()` method, its return
896
+ * value would be cloned.
897
+ *
898
+ * For reference, this `typia.clone()` function does not validate the input value type.
899
+ * It just believes that the input value is following the type `T`. Therefore, if you
900
+ * can't ensure the input value type, it would be better to call {@link assertClone}
901
+ * function instead.
902
+ *
903
+ * @template T Type of the input value
904
+ * @param input A value to be cloned
905
+ * @return Cloned data
906
+ *
907
+ * @author Jeongho Nam - https://github.com/samchon
908
+ */
909
+ export function clone<T>(input: T): Primitive<T>;
910
+
911
+ /**
912
+ * @internal
913
+ */
914
+ export function clone(): never {
915
+ halt("clone");
916
+ }
917
+ Object.assign(clone, Namespace.clone("clone"));
918
+
919
+ /**
920
+ * Clone a data with type assertion.
921
+ *
922
+ * Clones an instance following type `T`, with type assertion. If the target `input`
923
+ * value or its member variable contains a class instance that is having a `toJSON()`
924
+ * method, its return value would be cloned.
925
+ *
926
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
927
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
928
+ * data would be returned.
929
+ *
930
+ * @template T Type of the input value
931
+ * @param input A value to be cloned
932
+ * @return Cloned data
933
+ *
934
+ * @author Jeongho Nam - https://github.com/samchon
935
+ */
936
+ export function assertClone<T>(input: T): Primitive<T>;
937
+
938
+ /**
939
+ * Clone a data with type assertion.
940
+ *
941
+ * Clones an instance following type `T`, with type assertion. If the target `input`
942
+ * value or its member variable contains a class instance that is having a `toJSON()`
943
+ * method, its return value would be cloned.
944
+ *
945
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
946
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
947
+ * data would be returned.
948
+ *
949
+ * @template T Type of the input value
950
+ * @param input A value to be cloned
951
+ * @return Cloned data
952
+ *
953
+ * @author Jeongho Nam - https://github.com/samchon
954
+ */
955
+ export function assertClone<T>(input: unknown): Primitive<T>;
956
+
957
+ /**
958
+ * @internal
959
+ */
960
+ export function assertClone(): never {
961
+ halt("assertClone");
962
+ }
963
+ Object.assign(assertClone, Namespace.assert("assertClone"));
964
+ Object.assign(assertClone, Namespace.clone("assertClone"));
965
+
966
+ /**
967
+ * Clone a data with type checking.
968
+ *
969
+ * Clones an instance following type `T`, with type checking. If the target `input`
970
+ * value or its member variable contains a class instance that is having a `toJSON()`
971
+ * method, its return value would be cloned.
972
+ *
973
+ * In such reason, when `input` value is not matched with the type `T`, it returns
974
+ * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
975
+ * data would be returned.
976
+ *
977
+ * @template T Type of the input value
978
+ * @param input A value to be cloned
979
+ * @return Cloned data when exact type, otherwise null
980
+ *
981
+ * @author Jeongho Nam - https://github.com/samchon
982
+ */
983
+ export function isClone<T>(input: T): Primitive<T> | null;
984
+
985
+ /**
986
+ * Clone a data with type checking.
987
+ *
988
+ * Clones an instance following type `T`, with type checking. If the target `input`
989
+ * value or its member variable contains a class instance that is having a `toJSON()`
990
+ * method, its return value would be cloned.
991
+ *
992
+ * In such reason, when `input` value is not matched with the type `T`, it returns
993
+ * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
994
+ * data would be returned.
995
+ *
996
+ * @template T Type of the input value
997
+ * @param input A value to be cloned
998
+ * @return Cloned data when exact type, otherwise null
999
+ *
1000
+ * @author Jeongho Nam - https://github.com/samchon
1001
+ */
1002
+ export function isClone<T>(input: unknown): Primitive<T> | null;
1003
+
1004
+ /**
1005
+ * @internal
1006
+ */
1007
+ export function isClone(): never {
1008
+ halt("isClone");
1009
+ }
1010
+ Object.assign(isClone, Namespace.is());
1011
+ Object.assign(isClone, Namespace.clone("isClone"));
1012
+
1013
+ /**
1014
+ * Clone a data with detailed type validation.
1015
+ *
1016
+ * Clones an instance following type `T`, with detailed type validation. If the target
1017
+ * `input` value or its member variable contains a class instance that is having a
1018
+ * `toJSON()` method, its return value would be cloned.
1019
+ *
1020
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1021
+ * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1022
+ * value, cloned data would be stored in `data` property of the output
1023
+ * {@link IValidation.Success} instance.
1024
+ *
1025
+ * @template T Type of the input value
1026
+ * @param input A value to be cloned
1027
+ * @returns Validation result with cloned value
1028
+ */
1029
+ export function validateClone<T>(input: T): IValidation<Primitive<T>>;
1030
+
1031
+ /**
1032
+ * Clone a data with detailed type validation.
1033
+ *
1034
+ * Clones an instance following type `T`, with detailed type validation. If the target
1035
+ * `input` value or its member variable contains a class instance that is having a
1036
+ * `toJSON()` method, its return value would be cloned.
1037
+ *
1038
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1039
+ * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1040
+ * value, cloned data would be stored in `data` property of the output
1041
+ * {@link IValidation.Success} instance.
1042
+ *
1043
+ * @template T Type of the input value
1044
+ * @param input A value to be cloned
1045
+ * @returns Validation result with cloned value
1046
+ */
1047
+ export function validateClone<T>(input: unknown): IValidation<Primitive<T>>;
1048
+
1049
+ /**
1050
+ * @internal
1051
+ */
1052
+ export function validateClone(): never {
1053
+ halt("validateClone");
1054
+ }
1055
+ Object.assign(validateClone, Namespace.validate());
1056
+ Object.assign(validateClone, Namespace.clone("validateClone"));
1057
+
1058
+ /**
1059
+ * Prune, erase superfluous properties.
1060
+ *
1061
+ * Remove every superfluous properties from the `input` object, even including nested
1062
+ * objects. Note that, as every superfluous properties would be deleted, you never can
1063
+ * read those superfluous properties after calling this `prune()` function.
1064
+ *
1065
+ * For reference, this `typia.prune()` function does not validate the input value type.
1066
+ * It just believes that the input value is following the type `T`. Therefore, if you
1067
+ * can't ensure the input value type, it would better to call one of below functions
1068
+ * instead.
1069
+ *
1070
+ * - {@link assertPrune}
1071
+ * - {@link isPrune}
1072
+ * - {@link validatePrune}
1073
+ *
1074
+ * @template T Type of the input value
1075
+ * @param input Target instance to prune
1076
+ *
1077
+ * @author Jeongho Nam - https://github.com/samchon
1078
+ */
1079
+ export function prune<T extends object>(input: T): void;
1080
+
1081
+ /**
1082
+ * @internal
1083
+ */
1084
+ export function prune(): never {
1085
+ halt("prune");
1086
+ }
1087
+ Object.assign(prune, Namespace.prune("prune"));
1088
+
1089
+ /**
1090
+ * Prune, erase superfluous properties, with type assertion.
1091
+ *
1092
+ * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1093
+ * Therefore, it removes every superfluous properties from the `input` object including
1094
+ * nested objects, with type assertion.
1095
+ *
1096
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
1097
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1098
+ * every superfluous properties would be removed, including nested objects.
1099
+ *
1100
+ * @template T Type of the input value
1101
+ * @param input Target instance to assert and prune
1102
+ *
1103
+ * @author Jeongho Nam - https://github.com/samchon
1104
+ */
1105
+ export function assertPrune<T>(input: T): T;
1106
+
1107
+ /**
1108
+ * Prune, erase superfluous properties, with type assertion.
1109
+ *
1110
+ * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1111
+ * Therefore, it removes every superfluous properties from the `input` object including
1112
+ * nested objects, with type assertion.
1113
+ *
1114
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
1115
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1116
+ * every superfluous properties would be removed, including nested objects.
1117
+ *
1118
+ * @template T Type of the input value
1119
+ * @param input Target instance to assert and prune
1120
+ *
1121
+ * @author Jeongho Nam - https://github.com/samchon
1122
+ */
1123
+ export function assertPrune<T>(input: unknown): T;
1124
+
1125
+ /**
1126
+ * @internal
1127
+ */
1128
+ export function assertPrune(): unknown {
1129
+ halt("assertPrune");
1130
+ }
1131
+ Object.assign(assertPrune, Namespace.assert("assertPrune"));
1132
+ Object.assign(assertPrune, Namespace.prune("assertPrune"));
1133
+
1134
+ /**
1135
+ * Prune, erase superfluous properties, with type checking.
1136
+ *
1137
+ * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1138
+ * Therefore, it removes every superfluous properties from the `input` object including
1139
+ * nested objects, with type checking.
1140
+ *
1141
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1142
+ * `false` value. Otherwise, there's no problem on the `input` value, it returns
1143
+ * `true` after removing every superfluous properties, including nested objects.
1144
+ *
1145
+ * @template T Type of the input value
1146
+ * @param input Target instance to check and prune
1147
+ * @returns Whether the parametric value is following the type `T` or not
1148
+ *
1149
+ * @author Jeongho Nam - https://github.com/samchon
1150
+ */
1151
+ export function isPrune<T>(input: T): input is T;
1152
+
1153
+ /**
1154
+ * Prune, erase superfluous properties, with type checking.
1155
+ *
1156
+ * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1157
+ * Therefore, it removes every superfluous properties from the `input` object including
1158
+ * nested objects, with type checking.
1159
+ *
1160
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1161
+ * `false` value. Otherwise, there's no problem on the `input` value, it returns
1162
+ * `true` after removing every superfluous properties, including nested objects.
1163
+ *
1164
+ * @template T Type of the input value
1165
+ * @param input Target instance to check and prune
1166
+ * @returns Whether the parametric value is following the type `T` or not
1167
+ *
1168
+ * @author Jeongho Nam - https://github.com/samchon
1169
+ */
1170
+ export function isPrune<T>(input: unknown): input is T;
1171
+
1172
+ /**
1173
+ * @internal
1174
+ */
1175
+ export function isPrune(): never {
1176
+ halt("isPrune");
1177
+ }
1178
+ Object.assign(isPrune, Namespace.is());
1179
+ Object.assign(isPrune, Namespace.prune("isPrune"));
1180
+
1181
+ /**
1182
+ * Prune, erase superfluous properties, with type validation.
1183
+ *
1184
+ * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1185
+ * Therefore, it removes every superfluous properties from the `input` object including
1186
+ * nested objects, with type validation.
1187
+ *
1188
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1189
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1190
+ * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1191
+ * removing every superfluous properties, including nested objects.
1192
+ *
1193
+ * @template T Type of the input value
1194
+ * @param input Target instance to validate and prune
1195
+ * @returns Validation result
1196
+ *
1197
+ * @author Jeongho Nam - https://github.com/samchon
1198
+ */
1199
+ export function validatePrune<T>(input: T): IValidation<T>;
1200
+
1201
+ /**
1202
+ * Prune, erase superfluous properties, with type validation.
1203
+ *
1204
+ * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1205
+ * Therefore, it removes every superfluous properties from the `input` object including
1206
+ * nested objects, with type validation.
1207
+ *
1208
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1209
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1210
+ * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1211
+ * removing every superfluous properties, including nested objects.
1212
+ *
1213
+ * @template T Type of the input value
1214
+ * @param input Target instance to validate and prune
1215
+ * @returns Validation result
1216
+ *
1217
+ * @author Jeongho Nam - https://github.com/samchon
1218
+ */
1219
+ export function validatePrune<T>(input: unknown): IValidation<T>;
1220
+
1221
+ /**
1222
+ * @internal
1223
+ */
1224
+ export function validatePrune<T>(): IValidation<T> {
1225
+ halt("validatePrune");
1226
+ }
1227
+ Object.assign(validatePrune, Namespace.prune("validatePrune"));
1228
+ Object.assign(validatePrune, Namespace.validate());
1229
+
1230
+ /* ===========================================================
1231
+ FACTORY FUNCTIONS
1232
+ - BASIC VALIDATORS
1233
+ - STRICT VALIDATORS
1234
+ - JSON FUNCTIONS
1235
+ - MISCELLANEOUS
1236
+ ==============================================================
1237
+ BASIC VALIDATORS
1238
+ ----------------------------------------------------------- */
1239
+ /**
1240
+ * Creates a reusable {@link assert} function.
1241
+ *
1242
+ * @danger You have to specify the generic argument `T`
1243
+ * @return Nothing until specifying the generic argument `T`
1244
+ * @throws compile error
1245
+ *
1246
+ * @author Jeongho Nam - https://github.com/samchon
1247
+ */
1248
+ export function createAssert(): never;
1249
+
1250
+ /**
1251
+ * Creates a reusable {@link assert} function.
1252
+ *
1253
+ * @template T Type of the input value
1254
+ * @returns A reusable `assert` function
1255
+ *
1256
+ * @author Jeongho Nam - https://github.com/samchon
1257
+ */
1258
+ export function createAssert<T>(): (input: unknown) => T;
1259
+
1260
+ /**
1261
+ * @internal
1262
+ */
1263
+ export function createAssert<T>(): (input: unknown) => T {
1264
+ halt("createAssert");
1265
+ }
1266
+ Object.assign(createAssert, assert);
1267
+
1268
+ /**
1269
+ * Creates a reusable {@link assertType} function.
1270
+ *
1271
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
1272
+ *
1273
+ * @danger You have to specify the generic argument `T`
1274
+ * @return Nothing until specifying the generic argument `T`
1275
+ * @throws compile error
1276
+ *
1277
+ * @author Jeongho Nam - https://github.com/samchon
1278
+ * @deprecated
1279
+ */
1280
+ export function createAssertType(): never;
1281
+
1282
+ /**
1283
+ * Creates a reusable {@link assertType} function.
1284
+ *
1285
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
1286
+ *
1287
+ * @template T Type of the input value
1288
+ * @returns A reusable `assert` function
1289
+ *
1290
+ * @author Jeongho Nam - https://github.com/samchon
1291
+ * @deprecated
1292
+ */
1293
+ export function createAssertType<T>(): (input: unknown) => T;
1294
+
1295
+ /**
1296
+ * @internal
1297
+ */
1298
+ export function createAssertType<T>(): (input: unknown) => T {
1299
+ halt("createAssertType");
1300
+ }
1301
+ Object.assign(createAssertType, assertType);
1302
+
1303
+ /**
1304
+ * Creates a reusable {@link is} function.
1305
+ *
1306
+ * @danger You have to specify the generic argument `T`
1307
+ * @return Nothing until specifying the generic argument `T`
1308
+ * @throws compile error
1309
+ *
1310
+ * @author Jeongho Nam - https://github.com/samchon
1311
+ */
1312
+ export function createIs(): never;
1313
+
1314
+ /**
1315
+ * Creates a reusable {@link is} function.
1316
+ *
1317
+ * @template T Type of the input value
1318
+ * @returns A reusable `is` function
1319
+ *
1320
+ * @author Jeongho Nam - https://github.com/samchon
1321
+ */
1322
+ export function createIs<T>(): (input: unknown) => input is T;
1323
+
1324
+ /**
1325
+ * @internal
1326
+ */
1327
+ export function createIs<T>(): (input: unknown) => input is T {
1328
+ halt("createIs");
1329
+ }
1330
+ Object.assign(createIs, is);
1331
+
1332
+ /**
1333
+ * Creates a reusable {@link validate} function.
1334
+ *
1335
+ * @danger You have to specify the generic argument `T`
1336
+ * @return Nothing until specifying the generic argument `T`
1337
+ * @throws compile error
1338
+ *
1339
+ * @author Jeongho Nam - https://github.com/samchon
1340
+ */
1341
+ export function createValidate(): never;
1342
+
1343
+ /**
1344
+ * Creates a reusable {@link validate} function.
1345
+ *
1346
+ * @template T Type of the input value
1347
+ * @returns A reusable `validate` function
1348
+ *
1349
+ * @author Jeongho Nam - https://github.com/samchon
1350
+ */
1351
+ export function createValidate<T>(): (input: unknown) => IValidation<T>;
1352
+
1353
+ /**
1354
+ * @internal
1355
+ */
1356
+ export function createValidate(): (input: unknown) => IValidation {
1357
+ halt("createValidate");
1358
+ }
1359
+ Object.assign(createValidate, validate);
1360
+
1361
+ /* -----------------------------------------------------------
1362
+ STRICT VALIDATORS
1363
+ ----------------------------------------------------------- */
1364
+ /**
1365
+ * Creates a reusable {@link assertEquals} function.
1366
+ *
1367
+ * @danger You have to specify the generic argument `T`
1368
+ * @return Nothing until specifying the generic argument `T`
1369
+ * @throws compile error
1370
+ *
1371
+ * @author Jeongho Nam - https://github.com/samchon
1372
+ */
1373
+ export function createAssertEquals(): never;
1374
+
1375
+ /**
1376
+ * Creates a reusable {@link assertEquals} function.
1377
+ *
1378
+ * @template T Type of the input value
1379
+ * @returns A reusable `assertEquals` function
1380
+ *
1381
+ * @author Jeongho Nam - https://github.com/samchon
1382
+ */
1383
+ export function createAssertEquals<T>(): (input: unknown) => T;
1384
+
1385
+ /**
1386
+ * @internal
1387
+ */
1388
+ export function createAssertEquals<T>(): (input: unknown) => T {
1389
+ halt("createAssertEquals");
1390
+ }
1391
+ Object.assign(createAssertEquals, assertEquals);
1392
+
1393
+ /**
1394
+ * Creates a reusable {@link equals} function.
1395
+ *
1396
+ * @danger You have to specify the generic argument `T`
1397
+ * @return Nothing until specifying the generic argument `T`
1398
+ * @throws compile error
1399
+ *
1400
+ * @author Jeongho Nam - https://github.com/samchon
1401
+ */
1402
+ export function createEquals(): never;
1403
+
1404
+ /**
1405
+ * Creates a reusable {@link equals} function.
1406
+ *
1407
+ * @template T Type of the input value
1408
+ * @returns A reusable `equals` function
1409
+ *
1410
+ * @author Jeongho Nam - https://github.com/samchon
1411
+ */
1412
+ export function createEquals<T>(): (input: unknown) => input is T;
1413
+
1414
+ /**
1415
+ * @internal
1416
+ */
1417
+ export function createEquals<T>(): (input: unknown) => input is T {
1418
+ halt("createEquals");
1419
+ }
1420
+ Object.assign(createEquals, equals);
1421
+
1422
+ /**
1423
+ * Creates a reusable {@link validateEquals} function.
1424
+ *
1425
+ * @danger You have to specify the generic argument `T`
1426
+ * @return Nothing until specifying the generic argument `T`
1427
+ * @throws compile error
1428
+ *
1429
+ * @author Jeongho Nam - https://github.com/samchon
1430
+ */
1431
+ export function createValidateEquals(): never;
1432
+
1433
+ /**
1434
+ * Creates a reusable {@link validateEquals} function.
1435
+ *
1436
+ * @template T Type of the input value
1437
+ * @returns A reusable `validateEquals` function
1438
+ *
1439
+ * @author Jeongho Nam - https://github.com/samchon
1440
+ */
1441
+ export function createValidateEquals<T>(): (input: unknown) => IValidation;
1442
+
1443
+ /**
1444
+ * @internal
1445
+ */
1446
+ export function createValidateEquals(): (input: unknown) => IValidation {
1447
+ halt("createValidateEquals");
1448
+ }
1449
+ Object.assign(createValidateEquals, validateEquals);
1450
+
1451
+ /* -----------------------------------------------------------
1452
+ JSON FUNCTIONS
1453
+ ----------------------------------------------------------- */
1454
+ /**
1455
+ * Creates a reusable {@link isParse} function.
1456
+ *
1457
+ * @danger You have to specify the generic argument `T`
1458
+ * @return Nothing until specifying the generic argument `T`
1459
+ * @throws compile error
1460
+ *
1461
+ * @author Jeongho Nam - https://github.com/samchon
1462
+ */
1463
+ export function createIsParse(): never;
1464
+
1465
+ /**
1466
+ * Creates a reusable {@link isParse} function.
1467
+ *
1468
+ * @template T Expected type of parsed value
1469
+ * @returns A reusable `isParse` function
1470
+ *
1471
+ * @author Jeongho Nam - https://github.com/samchon
1472
+ */
1473
+ export function createIsParse<T>(): (input: string) => Primitive<T> | null;
1474
+
1475
+ /**
1476
+ * @internal
1477
+ */
1478
+ export function createIsParse<T>(): (input: string) => Primitive<T> | null {
1479
+ halt("createIsParse");
1480
+ }
1481
+ Object.assign(createIsParse, isParse);
1482
+
1483
+ /**
1484
+ * Creates a reusable {@link assertParse} function.
1485
+ *
1486
+ * @danger You have to specify the generic argument `T`
1487
+ * @return Nothing until specifying the generic argument `T`
1488
+ * @throws compile error
1489
+ *
1490
+ * @author Jeongho Nam - https://github.com/samchon
1491
+ */
1492
+ export function createAssertParse(): never;
1493
+
1494
+ /**
1495
+ * Creates a reusable {@link assertParse} function.
1496
+ *
1497
+ * @template T Expected type of parsed value
1498
+ * @returns A reusable `assertParse` function
1499
+ *
1500
+ * @author Jeongho Nam - https://github.com/samchon
1501
+ */
1502
+ export function createAssertParse<T>(): (input: string) => Primitive<T>;
1503
+
1504
+ /**
1505
+ * @internal
1506
+ */
1507
+ export function createAssertParse<T>(): (input: string) => Primitive<T> {
1508
+ halt("createAssertParse");
1509
+ }
1510
+ Object.assign(createAssertParse, assertParse);
1511
+
1512
+ /**
1513
+ * Creates a reusable {@link validateParse} function.
1514
+ *
1515
+ * @danger You have to specify the generic argument `T`
1516
+ * @return Nothing until specifying the generic argument `T`
1517
+ * @throws compile error
1518
+ *
1519
+ * @author Jeongho Nam - https://github.com/samchon
1520
+ */
1521
+ export function createValidateParse(): never;
1522
+
1523
+ /**
1524
+ * Creates a reusable {@link validateParse} function.
1525
+ *
1526
+ * @template T Expected type of parsed value
1527
+ * @returns A reusable `validateParse` function
1528
+ *
1529
+ * @author Jeongho Nam - https://github.com/samchon
1530
+ */
1531
+ export function createValidateParse<T>(): (
1532
+ input: string,
1533
+ ) => IValidation<Primitive<T>>;
1534
+
1535
+ /**
1536
+ * @internal
1537
+ */
1538
+ export function createValidateParse<T>(): (
1539
+ input: string,
1540
+ ) => IValidation<Primitive<T>> {
1541
+ halt("createValidateParse");
1542
+ }
1543
+ Object.assign(createValidateParse, validateParse);
1544
+
1545
+ /**
1546
+ * Creates a reusable {@link stringify} function.
1547
+ *
1548
+ * @danger You have to specify the generic argument `T`
1549
+ * @return Nothing until specifying the generic argument `T`
1550
+ * @throws compile error
1551
+ *
1552
+ * @author Jeongho Nam - https://github.com/samchon
1553
+ */
1554
+ export function createStringify(): never;
1555
+
1556
+ /**
1557
+ * Creates a reusable {@link stringify} function.
1558
+ *
1559
+ * @template T Type of the input value
1560
+ * @returns A reusable `stringify` function
1561
+ *
1562
+ * @author Jeongho Nam - https://github.com/samchon
1563
+ */
1564
+ export function createStringify<T>(): (input: T) => string;
1565
+
1566
+ /**
1567
+ * @internal
1568
+ */
1569
+ export function createStringify<T>(): (input: T) => string {
1570
+ halt("createStringify");
1571
+ }
1572
+ Object.assign(createStringify, stringify);
1573
+
1574
+ /**
1575
+ * Creates a reusable {@link assertStringify} function.
1576
+ *
1577
+ * @danger You have to specify the generic argument `T`
1578
+ * @return Nothing until specifying the generic argument `T`
1579
+ * @throws compile error
1580
+ *
1581
+ * @author Jeongho Nam - https://github.com/samchon
1582
+ */
1583
+ export function createAssertStringify(): never;
1584
+
1585
+ /**
1586
+ * Creates a reusable {@link assertStringify} function.
1587
+ *
1588
+ * @template T Type of the input value
1589
+ * @returns A reusable `assertStringify` function
1590
+ *
1591
+ * @author Jeongho Nam - https://github.com/samchon
1592
+ */
1593
+ export function createAssertStringify<T>(): (input: unknown) => string;
1594
+
1595
+ /**
1596
+ * @internal
1597
+ */
1598
+ export function createAssertStringify(): (input: unknown) => string {
1599
+ halt("createAssertStringify");
1600
+ }
1601
+ Object.assign(createAssertStringify, assertStringify);
1602
+
1603
+ /**
1604
+ * Creates a reusable {@link isStringify} function.
1605
+ *
1606
+ * @danger You have to specify the generic argument `T`
1607
+ * @return Nothing until specifying the generic argument `T`
1608
+ * @throws compile error
1609
+ *
1610
+ * @author Jeongho Nam - https://github.com/samchon
1611
+ */
1612
+ export function createIsStringify(): never;
1613
+
1614
+ /**
1615
+ * Creates a reusable {@link isStringify} function.
1616
+ *
1617
+ * @template T Type of the input value
1618
+ * @returns A reusable `isStringify` function
1619
+ *
1620
+ * @author Jeongho Nam - https://github.com/samchon
1621
+ */
1622
+ export function createIsStringify<T>(): (input: unknown) => string | null;
1623
+
1624
+ /**
1625
+ * @internal
1626
+ */
1627
+ export function createIsStringify(): (input: unknown) => string | null {
1628
+ halt("createIsStringify");
1629
+ }
1630
+ Object.assign(createIsStringify, isStringify);
1631
+
1632
+ /**
1633
+ * Creates a reusable {@link validateStringify} function.
1634
+ *
1635
+ * @danger You have to specify the generic argument `T`
1636
+ * @return Nothing until specifying the generic argument `T`
1637
+ * @throws compile error
1638
+ *
1639
+ * @author Jeongho Nam - https://github.com/samchon
1640
+ */
1641
+ export function createValidateStringify(): never;
1642
+
1643
+ /**
1644
+ * Creates a reusable {@link validateStringify} function.
1645
+ *
1646
+ * @template T Type of the input value
1647
+ * @returns A reusable `validateStringify` function
1648
+
1649
+ * @author Jeongho Nam - https://github.com/samchon
1650
+ */
1651
+ export function createValidateStringify<T>(): (
1652
+ input: unknown,
1653
+ ) => IValidation<string>;
1654
+
1655
+ /**
1656
+ * @internal
1657
+ */
1658
+ export function createValidateStringify(): (
1659
+ input: unknown,
1660
+ ) => IValidation<string> {
1661
+ halt("createValidateStringify");
1662
+ }
1663
+ Object.assign(createValidateStringify, validateStringify);
1664
+
1665
+ /* -----------------------------------------------------------
1666
+ MISCELLANEOUS
1667
+ ----------------------------------------------------------- */
1668
+ /**
1669
+ * Creates a reusable {@link random} function.
1670
+ *
1671
+ * @danger You have to specify the generic argument `T`
1672
+ * @param generator Random data generator
1673
+ * @return Nothing until specifying the generic argument `T`
1674
+ * @throws compile error
1675
+ *
1676
+ * @author Jeongho Nam - https://github.com/samchon
1677
+ */
1678
+ export function createRandom(generator?: Partial<IRandomGenerator>): never;
1679
+
1680
+ /**
1681
+ * Creates a resuable {@link random} function.
1682
+ *
1683
+ * @template T Type of the input value
1684
+ * @param generator Random data generator
1685
+ * @returns A reusable `random` function
1686
+ *
1687
+ * @author Jeongho Nam - https://github.com/samchon
1688
+ */
1689
+ export function createRandom<T>(
1690
+ generator?: Partial<IRandomGenerator>,
1691
+ ): () => Primitive<T>;
1692
+
1693
+ /**
1694
+ * @internal
1695
+ */
1696
+ export function createRandom(): never {
1697
+ halt("createRandom");
1698
+ }
1699
+ Object.assign(createRandom, random);
1700
+
1701
+ /**
1702
+ * Creates a reusable {@link clone} function.
1703
+ *
1704
+ * @danger You have to specify the generic argument `T`
1705
+ * @return Nothing until specifying the generic argument `T`
1706
+ * @throws compile error
1707
+ *
1708
+ * @author Jeongho Nam - https://github.com/samchon
1709
+ */
1710
+ export function createClone(): never;
1711
+
1712
+ /**
1713
+ * Creates a resuable {@link clone} function.
1714
+ *
1715
+ * @template T Type of the input value
1716
+ * @returns A reusable `clone` function
1717
+ *
1718
+ * @author Jeongho Nam - https://github.com/samchon
1719
+ */
1720
+ export function createClone<T>(): (input: T) => Primitive<T>;
1721
+
1722
+ /**
1723
+ * @internal
1724
+ */
1725
+ export function createClone(): never {
1726
+ halt("createClone");
1727
+ }
1728
+ Object.assign(createClone, clone);
1729
+
1730
+ /**
1731
+ * Creates a reusable {@link assertClone} function.
1732
+ *
1733
+ * @danger You have to specify the generic argument `T`
1734
+ * @return Nothing until specifying the generic argument `T`
1735
+ * @throws compile error
1736
+ *
1737
+ * @author Jeongho Nam - https://github.com/samchon
1738
+ */
1739
+ export function createAssertClone(): never;
1740
+
1741
+ /**
1742
+ * Creates a resuable {@link assertClone} function.
1743
+ *
1744
+ * @template T Type of the input value
1745
+ * @returns A reusable `clone` function
1746
+ *
1747
+ * @author Jeongho Nam - https://github.com/samchon
1748
+ */
1749
+ export function createAssertClone<T>(): (input: unknown) => Primitive<T>;
1750
+
1751
+ /**
1752
+ * @internal
1753
+ */
1754
+ export function createAssertClone(): never {
1755
+ halt("createAssertClone");
1756
+ }
1757
+ Object.assign(createAssertClone, assertClone);
1758
+
1759
+ /**
1760
+ * Creates a reusable {@link isClone} function.
1761
+ *
1762
+ * @danger You have to specify the generic argument `T`
1763
+ * @return Nothing until specifying the generic argument `T`
1764
+ * @throws compile error
1765
+ *
1766
+ * @author Jeongho Nam - https://github.com/samchon
1767
+ */
1768
+ export function createIsClone(): never;
1769
+
1770
+ /**
1771
+ * Creates a resuable {@link isClone} function.
1772
+ *
1773
+ * @template T Type of the input value
1774
+ * @returns A reusable `clone` function
1775
+ *
1776
+ * @author Jeongho Nam - https://github.com/samchon
1777
+ */
1778
+ export function createIsClone<T>(): (input: unknown) => Primitive<T> | null;
1779
+
1780
+ /**
1781
+ * @internal
1782
+ */
1783
+ export function createIsClone(): never {
1784
+ halt("createIsClone");
1785
+ }
1786
+ Object.assign(createIsClone, isClone);
1787
+
1788
+ /**
1789
+ * Creates a reusable {@link validateClone} function.
1790
+ *
1791
+ * @danger You have to specify the generic argument `T`
1792
+ * @return Nothing until specifying the generic argument `T`
1793
+ * @throws compile error
1794
+ *
1795
+ * @author Jeongho Nam - https://github.com/samchon
1796
+ */
1797
+ export function createValidateClone(): never;
1798
+
1799
+ /**
1800
+ * Creates a resuable {@link validateClone} function.
1801
+ *
1802
+ * @template T Type of the input value
1803
+ * @returns A reusable `clone` function
1804
+ *
1805
+ * @author Jeongho Nam - https://github.com/samchon
1806
+ */
1807
+ export function createValidateClone<T>(): (
1808
+ input: unknown,
1809
+ ) => IValidation<Primitive<T>>;
1810
+
1811
+ /**
1812
+ * @internal
1813
+ */
1814
+ export function createValidateClone(): never {
1815
+ halt("createValidateClone");
1816
+ }
1817
+ Object.assign(createValidateClone, validateClone);
1818
+
1819
+ /**
1820
+ * Creates a reusable {@link prune} function.
1821
+ *
1822
+ * @danger You have to specify the generic argument `T`
1823
+ * @return Nothing until specifying the generic argument `T`
1824
+ * @throws compile error
1825
+ *
1826
+ * @author Jeongho Nam - https://github.com/samchon
1827
+ */
1828
+ export function createPrune(): never;
1829
+
1830
+ /**
1831
+ * Creates a resuable {@link prune} function.
1832
+ *
1833
+ * @template T Type of the input value
1834
+ * @returns A reusable `prune` function
1835
+ *
1836
+ * @author Jeongho Nam - https://github.com/samchon
1837
+ */
1838
+ export function createPrune<T extends object>(): (input: T) => void;
1839
+
1840
+ /**
1841
+ * @internal
1842
+ */
1843
+ export function createPrune<T extends object>(): (input: T) => void {
1844
+ halt("createPrune");
1845
+ }
1846
+ Object.assign(createPrune, prune);
1847
+
1848
+ /**
1849
+ * Creates a reusable {@link assertPrune} function.
1850
+ *
1851
+ * @danger You have to specify the generic argument `T`
1852
+ * @return Nothing until specifying the generic argument `T`
1853
+ * @throws compile error
1854
+ *
1855
+ * @author Jeongho Nam - https://github.com/samchon
1856
+ */
1857
+ export function createAssertPrune(): never;
1858
+
1859
+ /**
1860
+ * Creates a resuable {@link assertPrune} function.
1861
+ *
1862
+ * @template T Type of the input value
1863
+ * @returns A reusable `isPrune` function
1864
+ *
1865
+ * @author Jeongho Nam - https://github.com/samchon
1866
+ */
1867
+ export function createAssertPrune<T extends object>(): (input: T) => T;
1868
+
1869
+ /**
1870
+ * @internal
1871
+ */
1872
+ export function createAssertPrune<T extends object>(): (input: T) => T {
1873
+ halt("createAssertPrune");
1874
+ }
1875
+ Object.assign(createAssertPrune, assertPrune);
1876
+
1877
+ /**
1878
+ * Creates a reusable {@link isPrune} function.
1879
+ *
1880
+ * @danger You have to specify the generic argument `T`
1881
+ * @return Nothing until specifying the generic argument `T`
1882
+ * @throws compile error
1883
+ *
1884
+ * @author Jeongho Nam - https://github.com/samchon
1885
+ */
1886
+ export function createIsPrune(): never;
1887
+
1888
+ /**
1889
+ * Creates a resuable {@link isPrune} function.
1890
+ *
1891
+ * @template T Type of the input value
1892
+ * @returns A reusable `isPrune` function
1893
+ *
1894
+ * @author Jeongho Nam - https://github.com/samchon
1895
+ */
1896
+ export function createIsPrune<T extends object>(): (input: T) => input is T;
1897
+
1898
+ /**
1899
+ * @internal
1900
+ */
1901
+ export function createIsPrune<T extends object>(): (input: T) => input is T {
1902
+ halt("createIsPrune");
1903
+ }
1904
+ Object.assign(createIsPrune, isPrune);
1905
+
1906
+ /**
1907
+ * Creates a reusable {@link validatePrune} function.
1908
+ *
1909
+ * @danger You have to specify the generic argument `T`
1910
+ * @return Nothing until specifying the generic argument `T`
1911
+ * @throws compile error
1912
+ *
1913
+ * @author Jeongho Nam - https://github.com/samchon
1914
+ */
1915
+ export function createValidatePrune(): never;
1916
+
1917
+ /**
1918
+ * Creates a resuable {@link validatePrune} function.
1919
+ *
1920
+ * @template T Type of the input value
1921
+ * @returns A reusable `validatePrune` function
1922
+ *
1923
+ * @author Jeongho Nam - https://github.com/samchon
1924
+ */
1925
+ export function createValidatePrune<T extends object>(): (
1926
+ input: T,
1927
+ ) => IValidation<T>;
1928
+
1929
+ /**
1930
+ * @internal
1931
+ */
1932
+ export function createValidatePrune<T extends object>(): (
1933
+ input: T,
1934
+ ) => IValidation<T> {
1935
+ halt("createValidatePrune");
1936
+ }
1937
+ Object.assign(createValidatePrune, validatePrune);
1938
+
1939
+ /**
1940
+ * @internal
1941
+ */
1942
+ function halt(name: string): never {
1943
+ throw new Error(
1944
+ `Error on typia.${name}(): no transform has been configured. Configure the "tsconfig.json" file following the [README.md#setup](https://github.com/samchon/typia#setup)`,
1945
+ );
1946
+ }