typia 5.1.3 → 5.1.4-dev.20230929

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 (66) hide show
  1. package/lib/executable/TypiaSetupWizard.js +1 -19
  2. package/lib/executable/TypiaSetupWizard.js.map +1 -1
  3. package/package.json +1 -1
  4. package/src/executable/TypiaSetupWizard.ts +1 -16
  5. package/src/factories/MetadataCollection.ts +277 -277
  6. package/src/factories/MetadataFactory.ts +238 -238
  7. package/src/factories/MetadataTypeTagFactory.ts +325 -325
  8. package/src/factories/internal/metadata/emend_metadata_atomics.ts +41 -41
  9. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +259 -259
  10. package/src/functional/$HeadersReader.ts +28 -28
  11. package/src/functional/$ParameterReader.ts +31 -31
  12. package/src/functional/$QueryReader.ts +56 -56
  13. package/src/functional/Namespace.ts +142 -142
  14. package/src/http.ts +1149 -1149
  15. package/src/json.ts +648 -648
  16. package/src/misc.ts +651 -651
  17. package/src/module.ts +657 -657
  18. package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
  19. package/src/programmers/http/HttpAssertHeadersProgrammer.ts +77 -77
  20. package/src/programmers/http/HttpAssertQueryProgrammer.ts +77 -77
  21. package/src/programmers/http/HttpHeadersProgrammer.ts +339 -339
  22. package/src/programmers/http/HttpIsHeadersProgrammer.ts +87 -87
  23. package/src/programmers/http/HttpIsQueryProgrammer.ts +87 -87
  24. package/src/programmers/http/HttpParameterProgrammer.ts +104 -104
  25. package/src/programmers/http/HttpQueryProgrammer.ts +273 -273
  26. package/src/programmers/http/HttpValidateHeadersProgrammer.ts +77 -77
  27. package/src/programmers/http/HttpValidateQueryProgrammer.ts +77 -77
  28. package/src/programmers/internal/application_boolean.ts +30 -30
  29. package/src/programmers/internal/application_number.ts +90 -90
  30. package/src/programmers/internal/application_schema.ts +180 -180
  31. package/src/programmers/internal/application_string.ts +54 -54
  32. package/src/programmers/internal/check_array_length.ts +44 -44
  33. package/src/programmers/internal/check_bigint.ts +48 -48
  34. package/src/programmers/internal/check_number.ts +108 -108
  35. package/src/programmers/internal/check_string.ts +48 -48
  36. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +882 -882
  37. package/src/protobuf.ts +887 -887
  38. package/src/schemas/json/IJsonComponents.ts +34 -34
  39. package/src/schemas/json/IJsonSchema.ts +112 -112
  40. package/src/schemas/metadata/IMetadataConstant.ts +25 -25
  41. package/src/schemas/metadata/IMetadataTypeTag.ts +8 -8
  42. package/src/schemas/metadata/Metadata.ts +686 -686
  43. package/src/tags/Default.ts +15 -15
  44. package/src/tags/Format.ts +30 -30
  45. package/src/tags/Pattern.ts +9 -9
  46. package/src/tags/TagBase.ts +68 -68
  47. package/src/tags/index.ts +14 -14
  48. package/src/transformers/CallExpressionTransformer.ts +289 -289
  49. package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +12 -12
  50. package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +12 -12
  51. package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
  52. package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
  53. package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
  54. package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
  55. package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
  56. package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
  57. package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +12 -12
  58. package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +10 -10
  59. package/src/transformers/features/http/HttpAssertQueryTransformer.ts +10 -10
  60. package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
  61. package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
  62. package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
  63. package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
  64. package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
  65. package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
  66. package/src/transformers/features/http/HttpValidateQueryTransformer.ts +10 -10
package/src/module.ts CHANGED
@@ -1,657 +1,657 @@
1
- import { Namespace } from "./functional/Namespace";
2
-
3
- import { IMetadataApplication } from "./schemas/metadata/IMetadataApplication";
4
-
5
- import { IRandomGenerator } from "./IRandomGenerator";
6
- import { IValidation } from "./IValidation";
7
- import { Resolved } from "./Resolved";
8
-
9
- export * as http from "./http";
10
- export * as json from "./json";
11
- export * as misc from "./misc";
12
- export * as protobuf from "./protobuf";
13
- export * as tags from "./tags";
14
-
15
- export * from "./schemas/json/IJsonApplication";
16
- export * from "./schemas/json/IJsonComponents";
17
- export * from "./schemas/json/IJsonSchema";
18
- export * from "./IRandomGenerator";
19
- export * from "./IValidation";
20
- export * from "./Primitive";
21
- export * from "./Resolved";
22
- export * from "./TypeGuardError";
23
-
24
- /* -----------------------------------------------------------
25
- BASIC VALIDATORS
26
- ----------------------------------------------------------- */
27
- /**
28
- * Asserts a value type.
29
- *
30
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
31
- * reason, if the parametric value is not following the type `T`. Otherwise, the
32
- * value is following the type `T`, just input parameter would be returned.
33
- *
34
- * If what you want is not asserting but just knowing whether the parametric value is
35
- * following the type `T` or not, you can choose the {@link is} function instead.
36
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
37
- *
38
- * On the other and, if you don't want to allow any superfluous property that is not
39
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
40
- *
41
- * @template T Type of the input value
42
- * @param input A value to be asserted
43
- * @returns Parametric input value
44
- * @throws A {@link TypeGuardError} instance with detailed reason
45
- *
46
- * @author Jeongho Nam - https://github.com/samchon
47
- */
48
- export function assert<T>(input: T): T;
49
-
50
- /**
51
- * Asserts a value type.
52
- *
53
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
54
- * reason, if the parametric value is not following the type `T`. Otherwise, the
55
- * value is following the type `T`, just input parameter would be returned.
56
- *
57
- * If what you want is not asserting but just knowing whether the parametric value is
58
- * following the type `T` or not, you can choose the {@link is} function instead.
59
- * Otherwise, you want to know all the errors, {@link validate} is the way to go.
60
- *
61
- * On the other and, if you don't want to allow any superfluous property that is not
62
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
63
- *
64
- * @template T Type of the input value
65
- * @param input A value to be asserted
66
- * @returns Parametric input value casted as `T`
67
- * @throws A {@link TypeGuardError} instance with detailed reason
68
- *
69
- * @author Jeongho Nam - https://github.com/samchon
70
- */
71
- export function assert<T>(input: unknown): T;
72
-
73
- /**
74
- * @internal
75
- */
76
- export function assert(): never {
77
- halt("assert");
78
- }
79
- Object.assign(assert, Namespace.assert("assert"));
80
-
81
- /**
82
- * Tests a value type.
83
- *
84
- * Tests a parametric value type and returns whether it's following the type `T` or not.
85
- * If the parametric value is matched with the type `T`, `true` value would be returned.
86
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
87
- * returned.
88
- *
89
- * If what you want is not just knowing whether the parametric value is following the
90
- * type `T` or not, but throwing an exception with detailed reason, you can choose
91
- * {@link assert} function instead. Also, if you want to know all the errors with
92
- * detailed reasons, {@link validate} function would be useful.
93
- *
94
- * On the other and, if you don't want to allow any superfluous property that is not
95
- * enrolled to the type `T`, you can use {@link equals} function instead.
96
- *
97
- * @template T Type of the input value
98
- * @param input A value to be tested
99
- * @returns Whether the parametric value is following the type `T` or not
100
- *
101
- * @author Jeongho Nam - https://github.com/samchon
102
- */
103
- export function is<T>(input: T): input is T;
104
-
105
- /**
106
- * Tests a value type.
107
- *
108
- * Tests a parametric value type and returns whether it's following the type `T` or not.
109
- * If the parametric value is matched with the type `T`, `true` value would be returned.
110
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
111
- * returned.
112
- *
113
- * If what you want is not just knowing whether the parametric value is following the
114
- * type `T` or not, but throwing an exception with detailed reason, you can choose
115
- * {@link assert} function instead. Also, if you want to know all the errors with
116
- * detailed reasons, {@link validate} function would be useful.
117
- *
118
- * On the other and, if you don't want to allow any superfluous property that is not
119
- * enrolled to the type `T`, you can use {@link equals} function instead.
120
- *
121
- * @template T Type of the input value
122
- * @param input A value to be tested
123
- * @returns Whether the parametric value is following the type `T` or not
124
- *
125
- * @author Jeongho Nam - https://github.com/samchon
126
- */
127
- export function is<T>(input: unknown): input is T;
128
-
129
- /**
130
- * @internal
131
- */
132
- export function is(): never {
133
- halt("is");
134
- }
135
- Object.assign(is, Namespace.assert("is"));
136
-
137
- /**
138
- * Validates a value type.
139
- *
140
- * Validates a parametric value type and archives all the type errors into an
141
- * {@link IValidation.errors} array, if the parametric value is not following the
142
- * type `T`. Of course, if the parametric value is following the type `T`, the
143
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
144
- * would have the `true` value.
145
- *
146
- * If what you want is not finding all the error, but asserting the parametric value
147
- * type with exception throwing, you can choose {@link assert} function instead.
148
- * Otherwise, you just want to know whether the parametric value is matched with the
149
- * type `T`, {@link is} function is the way to go.
150
- *
151
- * On the other and, if you don't want to allow any superfluous property that is not
152
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
153
- *
154
- * @template Type of the input value
155
- * @param input A value to be validated
156
- * @returns Validation result
157
- *
158
- * @author Jeongho Nam - https://github.com/samchon
159
- */
160
- export function validate<T>(input: T): IValidation<T>;
161
-
162
- /**
163
- * Validates a value type.
164
- *
165
- * Validates a parametric value type and archives all the type errors into an
166
- * {@link IValidation.errors} array, if the parametric value is not following the
167
- * type `T`. Of course, if the parametric value is following the type `T`, the
168
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
169
- * would have the `true` value.
170
- *
171
- * If what you want is not finding all the error, but asserting the parametric value
172
- * type with exception throwing, you can choose {@link assert} function instead.
173
- * Otherwise, you just want to know whether the parametric value is matched with the
174
- * type `T`, {@link is} function is the way to go.
175
- *
176
- * On the other and, if you don't want to allow any superfluous property that is not
177
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
178
- *
179
- * @template Type of the input value
180
- * @param input A value to be validated
181
- * @returns Validation result
182
- *
183
- * @author Jeongho Nam - https://github.com/samchon
184
- */
185
- export function validate<T>(input: unknown): IValidation<T>;
186
-
187
- /**
188
- * @internal
189
- */
190
- export function validate(): never {
191
- halt("validate");
192
- }
193
- Object.assign(validate, Namespace.validate());
194
-
195
- /* -----------------------------------------------------------
196
- STRICT VALIDATORS
197
- ----------------------------------------------------------- */
198
- /**
199
- * Asserts equality between a value and its type.
200
- *
201
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
202
- * reason, if the parametric value is not following the type `T` or some superfluous
203
- * property that is not listed on the type `T` has been found. Otherwise, the value is
204
- * following the type `T` without any superfluous property, just input parameter would
205
- * be returned.
206
- *
207
- * If what you want is not asserting but just knowing whether the parametric value is
208
- * following the type `T` or not, you can choose the {@link equals} function instead.
209
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
210
- *
211
- * On the other hand, if you want to allow superfluous property that is not enrolled
212
- * to the type `T`, you can use {@link assert} function instead.
213
- *
214
- * @template T Type of the input value
215
- * @param input A value to be asserted
216
- * @returns Parametric input value
217
- * @throws A {@link TypeGuardError} instance with detailed reason
218
- *
219
- * @author Jeongho Nam - https://github.com/samchon
220
- */
221
- export function assertEquals<T>(input: T): T;
222
-
223
- /**
224
- * Asserts equality between a value and its type.
225
- *
226
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
227
- * reason, if the parametric value is not following the type `T` or some superfluous
228
- * property that is not listed on the type `T` has been found. Otherwise, the value is
229
- * following the type `T` without any superfluous property, just input parameter would
230
- * be returned.
231
- *
232
- * If what you want is not asserting but just knowing whether the parametric value is
233
- * following the type `T` or not, you can choose the {@link equals} function instead.
234
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
235
- *
236
- * On the other hand, if you want to allow superfluous property that is not enrolled
237
- * to the type `T`, you can use {@link assert} function instead.
238
- *
239
- * @template T Type of the input value
240
- * @param input A value to be asserted
241
- * @returns Parametric input value casted as `T`
242
- * @throws A {@link TypeGuardError} instance with detailed reason
243
- *
244
- * @author Jeongho Nam - https://github.com/samchon
245
- */
246
- export function assertEquals<T>(input: unknown): T;
247
-
248
- /**
249
- * @internal
250
- */
251
- export function assertEquals(): never {
252
- halt("assertEquals");
253
- }
254
- Object.assign(assertEquals, Namespace.assert("assertEquals"));
255
-
256
- /**
257
- * Tests equality between a value and its type.
258
- *
259
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
260
- * or not. If the parametric value is matched with the type `T` and there's not any
261
- * superfluous property that is not listed on the type `T`, `true` value would be
262
- * returned. Otherwise, the parametric value is not following the type `T` or some
263
- * superfluous property exists, `false` value would be returned.
264
- *
265
- * If what you want is not just knowing whether the parametric value is following the
266
- * type `T` or not, but throwing an exception with detailed reason, you can choose
267
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
268
- * detailed reasons, {@link validateEquals} function would be useful.
269
- *
270
- * On the other hand, if you want to allow superfluous property that is not enrolled
271
- * to the type `T`, you can use {@link is} function instead.
272
- *
273
- * @template T Type of the input value
274
- * @param input A value to be tested
275
- * @returns Whether the parametric value is equivalent to the type `T` or not
276
- *
277
- * @author Jeongho Nam - https://github.com/samchon
278
- */
279
- export function equals<T>(input: T): input is T;
280
-
281
- /**
282
- * Tests equality between a value and its type.
283
- *
284
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
285
- * or not. If the parametric value is matched with the type `T` and there's not any
286
- * superfluous property that is not listed on the type `T`, `true` value would be
287
- * returned. Otherwise, the parametric value is not following the type `T` or some
288
- * superfluous property exists, `false` value would be returned.
289
- *
290
- * If what you want is not just knowing whether the parametric value is following the
291
- * type `T` or not, but throwing an exception with detailed reason, you can choose
292
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
293
- * detailed reasons, {@link validateEquals} function would be useful.
294
- *
295
- * On the other hand, if you want to allow superfluous property that is not enrolled
296
- * to the type `T`, you can use {@link is} function instead.
297
- *
298
- * @template T Type of the input value
299
- * @param input A value to be tested
300
- * @returns Whether the parametric value is equivalent to the type `T` or not
301
- *
302
- * @author Jeongho Nam - https://github.com/samchon
303
- */
304
- export function equals<T>(input: unknown): input is T;
305
-
306
- /**
307
- * @internal
308
- */
309
- export function equals(): never {
310
- halt("equals");
311
- }
312
- Object.assign(equals, Namespace.is());
313
-
314
- /**
315
- * Validates equality between a value and its type.
316
- *
317
- * Validates a parametric value type and archives all the type errors into an
318
- * {@link IValidation.errors} array, if the parametric value is not following the
319
- * type `T` or some superfluous property that is not listed on the type `T` has been
320
- * found. Of course, if the parametric value is following the type `T` and no
321
- * superfluous property exists, the {@link IValidation.errors} array would be empty
322
- * and {@link IValidation.success} would have the `true` value.
323
- *
324
- * If what you want is not finding all the error, but asserting the parametric value
325
- * type with exception throwing, you can choose {@link assert} function instead.
326
- * Otherwise, you just want to know whether the parametric value is matched with the
327
- * type `T`, {@link is} function is the way to go.
328
- *
329
- * On the other and, if you don't want to allow any superfluous property that is not
330
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
331
- *
332
- * @template Type of the input value
333
- * @param input A value to be validated
334
- * @returns Validation result
335
- *
336
- * @author Jeongho Nam - https://github.com/samchon
337
- */
338
- export function validateEquals<T>(input: T): IValidation<T>;
339
-
340
- /**
341
- * Validates equality between a value and its type.
342
- *
343
- * Validates a parametric value type and archives all the type errors into an
344
- * {@link IValidation.errors} array, if the parametric value is not following the
345
- * type `T` or some superfluous property that is not listed on the type `T` has been
346
- * found. Of course, if the parametric value is following the type `T` and no
347
- * superfluous property exists, the {@link IValidation.errors} array would be empty
348
- * and {@link IValidation.success} would have the `true` value.
349
- *
350
- * If what you want is not finding all the error, but asserting the parametric value
351
- * type with exception throwing, you can choose {@link assert} function instead.
352
- * Otherwise, you just want to know whether the parametric value is matched with the
353
- * type `T`, {@link is} function is the way to go.
354
- *
355
- * On the other and, if you don't want to allow any superfluous property that is not
356
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
357
- *
358
- * @template Type of the input value
359
- * @param input A value to be validated
360
- * @returns Validation result
361
- *
362
- * @author Jeongho Nam - https://github.com/samchon
363
- */
364
- export function validateEquals<T>(input: unknown): IValidation<T>;
365
-
366
- /**
367
- * @internal
368
- */
369
- export function validateEquals(): never {
370
- halt("validateEquals");
371
- }
372
- Object.assign(validateEquals, Namespace.validate());
373
-
374
- /* -----------------------------------------------------------
375
- RANDOM
376
- ----------------------------------------------------------- */
377
- /**
378
- * > You must configure the generic argument `T`.
379
- *
380
- * Generate random data.
381
- *
382
- * Generates a random data following type the `T`.
383
- *
384
- * For reference, this `typia.random()` function generates only primitive type.
385
- * If there're some methods in the type `T` or its nested instances, those would
386
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
387
- * would be generated instead.
388
- *
389
- * @template T Type of data to generate
390
- * @param generator Random data generator
391
- * @return Randomly generated data
392
- *
393
- * @author Jeongho Nam - https://github.com/samchon
394
- */
395
- export function random(generator?: Partial<IRandomGenerator>): never;
396
-
397
- /**
398
- * Generate random data.
399
- *
400
- * Generates a random data following type the `T`.
401
- *
402
- * For reference, this `typia.random()` function generates only primitive type.
403
- * If there're some methods in the type `T` or its nested instances, those would
404
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
405
- * would be generated instead.
406
- *
407
- * @template T Type of data to generate
408
- * @param generator Random data generator
409
- * @return Randomly generated data
410
- *
411
- * @author Jeongho Nam - https://github.com/samchon
412
- */
413
- export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
414
-
415
- /**
416
- * @internal
417
- */
418
- export function random(): never {
419
- halt("random");
420
- }
421
- Object.assign(random, Namespace.random());
422
-
423
- /**
424
- * @internal
425
- */
426
- export function metadata(): never;
427
-
428
- /**
429
- * @internal
430
- */
431
- export function metadata<Types extends unknown[]>(): IMetadataApplication;
432
-
433
- /**
434
- * @internal
435
- */
436
- export function metadata(): never {
437
- halt("metadata");
438
- }
439
-
440
- /* -----------------------------------------------------------
441
- FACTORY FUNCTIONS
442
- ----------------------------------------------------------- */
443
- /**
444
- * Creates a reusable {@link assert} function.
445
- *
446
- * @danger You must configure the generic argument `T`
447
- * @returns Nothing until you configure the generic argument `T`
448
- * @throws compile error
449
- *
450
- * @author Jeongho Nam - https://github.com/samchon
451
- */
452
- export function createAssert(): never;
453
-
454
- /**
455
- * Creates a reusable {@link assert} function.
456
- *
457
- * @template T Type of the input value
458
- * @returns A reusable `assert` function
459
- *
460
- * @author Jeongho Nam - https://github.com/samchon
461
- */
462
- export function createAssert<T>(): (input: unknown) => T;
463
-
464
- /**
465
- * @internal
466
- */
467
- export function createAssert<T>(): (input: unknown) => T {
468
- halt("createAssert");
469
- }
470
- Object.assign(createAssert, assert);
471
-
472
- /**
473
- * Creates a reusable {@link is} function.
474
- *
475
- * @danger You must configure the generic argument `T`
476
- * @returns Nothing until you configure the generic argument `T`
477
- * @throws compile error
478
- *
479
- * @author Jeongho Nam - https://github.com/samchon
480
- */
481
- export function createIs(): never;
482
-
483
- /**
484
- * Creates a reusable {@link is} function.
485
- *
486
- * @template T Type of the input value
487
- * @returns A reusable `is` function
488
- *
489
- * @author Jeongho Nam - https://github.com/samchon
490
- */
491
- export function createIs<T>(): (input: unknown) => input is T;
492
-
493
- /**
494
- * @internal
495
- */
496
- export function createIs<T>(): (input: unknown) => input is T {
497
- halt("createIs");
498
- }
499
- Object.assign(createIs, is);
500
-
501
- /**
502
- * Creates a reusable {@link validate} function.
503
- *
504
- * @danger You must configure the generic argument `T`
505
- * @returns Nothing until you configure the generic argument `T`
506
- * @throws compile error
507
- *
508
- * @author Jeongho Nam - https://github.com/samchon
509
- */
510
- export function createValidate(): never;
511
-
512
- /**
513
- * Creates a reusable {@link validate} function.
514
- *
515
- * @template T Type of the input value
516
- * @returns A reusable `validate` function
517
- *
518
- * @author Jeongho Nam - https://github.com/samchon
519
- */
520
- export function createValidate<T>(): (input: unknown) => IValidation<T>;
521
-
522
- /**
523
- * @internal
524
- */
525
- export function createValidate(): (input: unknown) => IValidation {
526
- halt("createValidate");
527
- }
528
- Object.assign(createValidate, validate);
529
-
530
- /**
531
- * Creates a reusable {@link assertEquals} function.
532
- *
533
- * @danger You must configure the generic argument `T`
534
- * @returns Nothing until you configure the generic argument `T`
535
- * @throws compile error
536
- *
537
- * @author Jeongho Nam - https://github.com/samchon
538
- */
539
- export function createAssertEquals(): never;
540
-
541
- /**
542
- * Creates a reusable {@link assertEquals} function.
543
- *
544
- * @template T Type of the input value
545
- * @returns A reusable `assertEquals` function
546
- *
547
- * @author Jeongho Nam - https://github.com/samchon
548
- */
549
- export function createAssertEquals<T>(): (input: unknown) => T;
550
-
551
- /**
552
- * @internal
553
- */
554
- export function createAssertEquals<T>(): (input: unknown) => T {
555
- halt("createAssertEquals");
556
- }
557
- Object.assign(createAssertEquals, assertEquals);
558
-
559
- /**
560
- * Creates a reusable {@link equals} function.
561
- *
562
- * @danger You must configure the generic argument `T`
563
- * @returns Nothing until you configure the generic argument `T`
564
- * @throws compile error
565
- *
566
- * @author Jeongho Nam - https://github.com/samchon
567
- */
568
- export function createEquals(): never;
569
-
570
- /**
571
- * Creates a reusable {@link equals} function.
572
- *
573
- * @template T Type of the input value
574
- * @returns A reusable `equals` function
575
- *
576
- * @author Jeongho Nam - https://github.com/samchon
577
- */
578
- export function createEquals<T>(): (input: unknown) => input is T;
579
-
580
- /**
581
- * @internal
582
- */
583
- export function createEquals<T>(): (input: unknown) => input is T {
584
- halt("createEquals");
585
- }
586
- Object.assign(createEquals, equals);
587
-
588
- /**
589
- * Creates a reusable {@link validateEquals} function.
590
- *
591
- * @danger You must configure the generic argument `T`
592
- * @returns Nothing until you configure the generic argument `T`
593
- * @throws compile error
594
- *
595
- * @author Jeongho Nam - https://github.com/samchon
596
- */
597
- export function createValidateEquals(): never;
598
-
599
- /**
600
- * Creates a reusable {@link validateEquals} function.
601
- *
602
- * @template T Type of the input value
603
- * @returns A reusable `validateEquals` function
604
- *
605
- * @author Jeongho Nam - https://github.com/samchon
606
- */
607
- export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
608
-
609
- /**
610
- * @internal
611
- */
612
- export function createValidateEquals(): (input: unknown) => IValidation {
613
- halt("createValidateEquals");
614
- }
615
- Object.assign(createValidateEquals, validateEquals);
616
-
617
- /**
618
- * Creates a reusable {@link random} function.
619
- *
620
- * @danger You must configure the generic argument `T`
621
- * @param generator Random data generator
622
- * @returns Nothing until you configure the generic argument `T`
623
- * @throws compile error
624
- *
625
- * @author Jeongho Nam - https://github.com/samchon
626
- */
627
- export function createRandom(generator?: Partial<IRandomGenerator>): never;
628
-
629
- /**
630
- * Creates a resuable {@link random} function.
631
- *
632
- * @template T Type of the input value
633
- * @param generator Random data generator
634
- * @returns A reusable `random` function
635
- *
636
- * @author Jeongho Nam - https://github.com/samchon
637
- */
638
- export function createRandom<T>(
639
- generator?: Partial<IRandomGenerator>,
640
- ): () => Resolved<T>;
641
-
642
- /**
643
- * @internal
644
- */
645
- export function createRandom(): never {
646
- halt("createRandom");
647
- }
648
- Object.assign(createRandom, random);
649
-
650
- /**
651
- * @internal
652
- */
653
- function halt(name: string): never {
654
- throw new Error(
655
- `Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
656
- );
657
- }
1
+ import { Namespace } from "./functional/Namespace";
2
+
3
+ import { IMetadataApplication } from "./schemas/metadata/IMetadataApplication";
4
+
5
+ import { IRandomGenerator } from "./IRandomGenerator";
6
+ import { IValidation } from "./IValidation";
7
+ import { Resolved } from "./Resolved";
8
+
9
+ export * as http from "./http";
10
+ export * as json from "./json";
11
+ export * as misc from "./misc";
12
+ export * as protobuf from "./protobuf";
13
+ export * as tags from "./tags";
14
+
15
+ export * from "./schemas/json/IJsonApplication";
16
+ export * from "./schemas/json/IJsonComponents";
17
+ export * from "./schemas/json/IJsonSchema";
18
+ export * from "./IRandomGenerator";
19
+ export * from "./IValidation";
20
+ export * from "./Primitive";
21
+ export * from "./Resolved";
22
+ export * from "./TypeGuardError";
23
+
24
+ /* -----------------------------------------------------------
25
+ BASIC VALIDATORS
26
+ ----------------------------------------------------------- */
27
+ /**
28
+ * Asserts a value type.
29
+ *
30
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
31
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
32
+ * value is following the type `T`, just input parameter would be returned.
33
+ *
34
+ * If what you want is not asserting but just knowing whether the parametric value is
35
+ * following the type `T` or not, you can choose the {@link is} function instead.
36
+ * Otherwise you want to know all the errors, {@link validate} is the way to go.
37
+ *
38
+ * On the other and, if you don't want to allow any superfluous property that is not
39
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
40
+ *
41
+ * @template T Type of the input value
42
+ * @param input A value to be asserted
43
+ * @returns Parametric input value
44
+ * @throws A {@link TypeGuardError} instance with detailed reason
45
+ *
46
+ * @author Jeongho Nam - https://github.com/samchon
47
+ */
48
+ export function assert<T>(input: T): T;
49
+
50
+ /**
51
+ * Asserts a value type.
52
+ *
53
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
54
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
55
+ * value is following the type `T`, just input parameter would be returned.
56
+ *
57
+ * If what you want is not asserting but just knowing whether the parametric value is
58
+ * following the type `T` or not, you can choose the {@link is} function instead.
59
+ * Otherwise, you want to know all the errors, {@link validate} is the way to go.
60
+ *
61
+ * On the other and, if you don't want to allow any superfluous property that is not
62
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
63
+ *
64
+ * @template T Type of the input value
65
+ * @param input A value to be asserted
66
+ * @returns Parametric input value casted as `T`
67
+ * @throws A {@link TypeGuardError} instance with detailed reason
68
+ *
69
+ * @author Jeongho Nam - https://github.com/samchon
70
+ */
71
+ export function assert<T>(input: unknown): T;
72
+
73
+ /**
74
+ * @internal
75
+ */
76
+ export function assert(): never {
77
+ halt("assert");
78
+ }
79
+ Object.assign(assert, Namespace.assert("assert"));
80
+
81
+ /**
82
+ * Tests a value type.
83
+ *
84
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
85
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
86
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
87
+ * returned.
88
+ *
89
+ * If what you want is not just knowing whether the parametric value is following the
90
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
91
+ * {@link assert} function instead. Also, if you want to know all the errors with
92
+ * detailed reasons, {@link validate} function would be useful.
93
+ *
94
+ * On the other and, if you don't want to allow any superfluous property that is not
95
+ * enrolled to the type `T`, you can use {@link equals} function instead.
96
+ *
97
+ * @template T Type of the input value
98
+ * @param input A value to be tested
99
+ * @returns Whether the parametric value is following the type `T` or not
100
+ *
101
+ * @author Jeongho Nam - https://github.com/samchon
102
+ */
103
+ export function is<T>(input: T): input is T;
104
+
105
+ /**
106
+ * Tests a value type.
107
+ *
108
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
109
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
110
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
111
+ * returned.
112
+ *
113
+ * If what you want is not just knowing whether the parametric value is following the
114
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
115
+ * {@link assert} function instead. Also, if you want to know all the errors with
116
+ * detailed reasons, {@link validate} function would be useful.
117
+ *
118
+ * On the other and, if you don't want to allow any superfluous property that is not
119
+ * enrolled to the type `T`, you can use {@link equals} function instead.
120
+ *
121
+ * @template T Type of the input value
122
+ * @param input A value to be tested
123
+ * @returns Whether the parametric value is following the type `T` or not
124
+ *
125
+ * @author Jeongho Nam - https://github.com/samchon
126
+ */
127
+ export function is<T>(input: unknown): input is T;
128
+
129
+ /**
130
+ * @internal
131
+ */
132
+ export function is(): never {
133
+ halt("is");
134
+ }
135
+ Object.assign(is, Namespace.assert("is"));
136
+
137
+ /**
138
+ * Validates a value type.
139
+ *
140
+ * Validates a parametric value type and archives all the type errors into an
141
+ * {@link IValidation.errors} array, if the parametric value is not following the
142
+ * type `T`. Of course, if the parametric value is following the type `T`, the
143
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
144
+ * would have the `true` value.
145
+ *
146
+ * If what you want is not finding all the error, but asserting the parametric value
147
+ * type with exception throwing, you can choose {@link assert} function instead.
148
+ * Otherwise, you just want to know whether the parametric value is matched with the
149
+ * type `T`, {@link is} function is the way to go.
150
+ *
151
+ * On the other and, if you don't want to allow any superfluous property that is not
152
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
153
+ *
154
+ * @template Type of the input value
155
+ * @param input A value to be validated
156
+ * @returns Validation result
157
+ *
158
+ * @author Jeongho Nam - https://github.com/samchon
159
+ */
160
+ export function validate<T>(input: T): IValidation<T>;
161
+
162
+ /**
163
+ * Validates a value type.
164
+ *
165
+ * Validates a parametric value type and archives all the type errors into an
166
+ * {@link IValidation.errors} array, if the parametric value is not following the
167
+ * type `T`. Of course, if the parametric value is following the type `T`, the
168
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
169
+ * would have the `true` value.
170
+ *
171
+ * If what you want is not finding all the error, but asserting the parametric value
172
+ * type with exception throwing, you can choose {@link assert} function instead.
173
+ * Otherwise, you just want to know whether the parametric value is matched with the
174
+ * type `T`, {@link is} function is the way to go.
175
+ *
176
+ * On the other and, if you don't want to allow any superfluous property that is not
177
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
178
+ *
179
+ * @template Type of the input value
180
+ * @param input A value to be validated
181
+ * @returns Validation result
182
+ *
183
+ * @author Jeongho Nam - https://github.com/samchon
184
+ */
185
+ export function validate<T>(input: unknown): IValidation<T>;
186
+
187
+ /**
188
+ * @internal
189
+ */
190
+ export function validate(): never {
191
+ halt("validate");
192
+ }
193
+ Object.assign(validate, Namespace.validate());
194
+
195
+ /* -----------------------------------------------------------
196
+ STRICT VALIDATORS
197
+ ----------------------------------------------------------- */
198
+ /**
199
+ * Asserts equality between a value and its type.
200
+ *
201
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
202
+ * reason, if the parametric value is not following the type `T` or some superfluous
203
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
204
+ * following the type `T` without any superfluous property, just input parameter would
205
+ * be returned.
206
+ *
207
+ * If what you want is not asserting but just knowing whether the parametric value is
208
+ * following the type `T` or not, you can choose the {@link equals} function instead.
209
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
210
+ *
211
+ * On the other hand, if you want to allow superfluous property that is not enrolled
212
+ * to the type `T`, you can use {@link assert} function instead.
213
+ *
214
+ * @template T Type of the input value
215
+ * @param input A value to be asserted
216
+ * @returns Parametric input value
217
+ * @throws A {@link TypeGuardError} instance with detailed reason
218
+ *
219
+ * @author Jeongho Nam - https://github.com/samchon
220
+ */
221
+ export function assertEquals<T>(input: T): T;
222
+
223
+ /**
224
+ * Asserts equality between a value and its type.
225
+ *
226
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
227
+ * reason, if the parametric value is not following the type `T` or some superfluous
228
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
229
+ * following the type `T` without any superfluous property, just input parameter would
230
+ * be returned.
231
+ *
232
+ * If what you want is not asserting but just knowing whether the parametric value is
233
+ * following the type `T` or not, you can choose the {@link equals} function instead.
234
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
235
+ *
236
+ * On the other hand, if you want to allow superfluous property that is not enrolled
237
+ * to the type `T`, you can use {@link assert} function instead.
238
+ *
239
+ * @template T Type of the input value
240
+ * @param input A value to be asserted
241
+ * @returns Parametric input value casted as `T`
242
+ * @throws A {@link TypeGuardError} instance with detailed reason
243
+ *
244
+ * @author Jeongho Nam - https://github.com/samchon
245
+ */
246
+ export function assertEquals<T>(input: unknown): T;
247
+
248
+ /**
249
+ * @internal
250
+ */
251
+ export function assertEquals(): never {
252
+ halt("assertEquals");
253
+ }
254
+ Object.assign(assertEquals, Namespace.assert("assertEquals"));
255
+
256
+ /**
257
+ * Tests equality between a value and its type.
258
+ *
259
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
260
+ * or not. If the parametric value is matched with the type `T` and there's not any
261
+ * superfluous property that is not listed on the type `T`, `true` value would be
262
+ * returned. Otherwise, the parametric value is not following the type `T` or some
263
+ * superfluous property exists, `false` value would be returned.
264
+ *
265
+ * If what you want is not just knowing whether the parametric value is following the
266
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
267
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
268
+ * detailed reasons, {@link validateEquals} function would be useful.
269
+ *
270
+ * On the other hand, if you want to allow superfluous property that is not enrolled
271
+ * to the type `T`, you can use {@link is} function instead.
272
+ *
273
+ * @template T Type of the input value
274
+ * @param input A value to be tested
275
+ * @returns Whether the parametric value is equivalent to the type `T` or not
276
+ *
277
+ * @author Jeongho Nam - https://github.com/samchon
278
+ */
279
+ export function equals<T>(input: T): input is T;
280
+
281
+ /**
282
+ * Tests equality between a value and its type.
283
+ *
284
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
285
+ * or not. If the parametric value is matched with the type `T` and there's not any
286
+ * superfluous property that is not listed on the type `T`, `true` value would be
287
+ * returned. Otherwise, the parametric value is not following the type `T` or some
288
+ * superfluous property exists, `false` value would be returned.
289
+ *
290
+ * If what you want is not just knowing whether the parametric value is following the
291
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
292
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
293
+ * detailed reasons, {@link validateEquals} function would be useful.
294
+ *
295
+ * On the other hand, if you want to allow superfluous property that is not enrolled
296
+ * to the type `T`, you can use {@link is} function instead.
297
+ *
298
+ * @template T Type of the input value
299
+ * @param input A value to be tested
300
+ * @returns Whether the parametric value is equivalent to the type `T` or not
301
+ *
302
+ * @author Jeongho Nam - https://github.com/samchon
303
+ */
304
+ export function equals<T>(input: unknown): input is T;
305
+
306
+ /**
307
+ * @internal
308
+ */
309
+ export function equals(): never {
310
+ halt("equals");
311
+ }
312
+ Object.assign(equals, Namespace.is());
313
+
314
+ /**
315
+ * Validates equality between a value and its type.
316
+ *
317
+ * Validates a parametric value type and archives all the type errors into an
318
+ * {@link IValidation.errors} array, if the parametric value is not following the
319
+ * type `T` or some superfluous property that is not listed on the type `T` has been
320
+ * found. Of course, if the parametric value is following the type `T` and no
321
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
322
+ * and {@link IValidation.success} would have the `true` value.
323
+ *
324
+ * If what you want is not finding all the error, but asserting the parametric value
325
+ * type with exception throwing, you can choose {@link assert} function instead.
326
+ * Otherwise, you just want to know whether the parametric value is matched with the
327
+ * type `T`, {@link is} function is the way to go.
328
+ *
329
+ * On the other and, if you don't want to allow any superfluous property that is not
330
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
331
+ *
332
+ * @template Type of the input value
333
+ * @param input A value to be validated
334
+ * @returns Validation result
335
+ *
336
+ * @author Jeongho Nam - https://github.com/samchon
337
+ */
338
+ export function validateEquals<T>(input: T): IValidation<T>;
339
+
340
+ /**
341
+ * Validates equality between a value and its type.
342
+ *
343
+ * Validates a parametric value type and archives all the type errors into an
344
+ * {@link IValidation.errors} array, if the parametric value is not following the
345
+ * type `T` or some superfluous property that is not listed on the type `T` has been
346
+ * found. Of course, if the parametric value is following the type `T` and no
347
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
348
+ * and {@link IValidation.success} would have the `true` value.
349
+ *
350
+ * If what you want is not finding all the error, but asserting the parametric value
351
+ * type with exception throwing, you can choose {@link assert} function instead.
352
+ * Otherwise, you just want to know whether the parametric value is matched with the
353
+ * type `T`, {@link is} function is the way to go.
354
+ *
355
+ * On the other and, if you don't want to allow any superfluous property that is not
356
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
357
+ *
358
+ * @template Type of the input value
359
+ * @param input A value to be validated
360
+ * @returns Validation result
361
+ *
362
+ * @author Jeongho Nam - https://github.com/samchon
363
+ */
364
+ export function validateEquals<T>(input: unknown): IValidation<T>;
365
+
366
+ /**
367
+ * @internal
368
+ */
369
+ export function validateEquals(): never {
370
+ halt("validateEquals");
371
+ }
372
+ Object.assign(validateEquals, Namespace.validate());
373
+
374
+ /* -----------------------------------------------------------
375
+ RANDOM
376
+ ----------------------------------------------------------- */
377
+ /**
378
+ * > You must configure the generic argument `T`.
379
+ *
380
+ * Generate random data.
381
+ *
382
+ * Generates a random data following type the `T`.
383
+ *
384
+ * For reference, this `typia.random()` function generates only primitive type.
385
+ * If there're some methods in the type `T` or its nested instances, those would
386
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
387
+ * would be generated instead.
388
+ *
389
+ * @template T Type of data to generate
390
+ * @param generator Random data generator
391
+ * @return Randomly generated data
392
+ *
393
+ * @author Jeongho Nam - https://github.com/samchon
394
+ */
395
+ export function random(generator?: Partial<IRandomGenerator>): never;
396
+
397
+ /**
398
+ * Generate random data.
399
+ *
400
+ * Generates a random data following type the `T`.
401
+ *
402
+ * For reference, this `typia.random()` function generates only primitive type.
403
+ * If there're some methods in the type `T` or its nested instances, those would
404
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
405
+ * would be generated instead.
406
+ *
407
+ * @template T Type of data to generate
408
+ * @param generator Random data generator
409
+ * @return Randomly generated data
410
+ *
411
+ * @author Jeongho Nam - https://github.com/samchon
412
+ */
413
+ export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
414
+
415
+ /**
416
+ * @internal
417
+ */
418
+ export function random(): never {
419
+ halt("random");
420
+ }
421
+ Object.assign(random, Namespace.random());
422
+
423
+ /**
424
+ * @internal
425
+ */
426
+ export function metadata(): never;
427
+
428
+ /**
429
+ * @internal
430
+ */
431
+ export function metadata<Types extends unknown[]>(): IMetadataApplication;
432
+
433
+ /**
434
+ * @internal
435
+ */
436
+ export function metadata(): never {
437
+ halt("metadata");
438
+ }
439
+
440
+ /* -----------------------------------------------------------
441
+ FACTORY FUNCTIONS
442
+ ----------------------------------------------------------- */
443
+ /**
444
+ * Creates a reusable {@link assert} function.
445
+ *
446
+ * @danger You must configure the generic argument `T`
447
+ * @returns Nothing until you configure the generic argument `T`
448
+ * @throws compile error
449
+ *
450
+ * @author Jeongho Nam - https://github.com/samchon
451
+ */
452
+ export function createAssert(): never;
453
+
454
+ /**
455
+ * Creates a reusable {@link assert} function.
456
+ *
457
+ * @template T Type of the input value
458
+ * @returns A reusable `assert` function
459
+ *
460
+ * @author Jeongho Nam - https://github.com/samchon
461
+ */
462
+ export function createAssert<T>(): (input: unknown) => T;
463
+
464
+ /**
465
+ * @internal
466
+ */
467
+ export function createAssert<T>(): (input: unknown) => T {
468
+ halt("createAssert");
469
+ }
470
+ Object.assign(createAssert, assert);
471
+
472
+ /**
473
+ * Creates a reusable {@link is} function.
474
+ *
475
+ * @danger You must configure the generic argument `T`
476
+ * @returns Nothing until you configure the generic argument `T`
477
+ * @throws compile error
478
+ *
479
+ * @author Jeongho Nam - https://github.com/samchon
480
+ */
481
+ export function createIs(): never;
482
+
483
+ /**
484
+ * Creates a reusable {@link is} function.
485
+ *
486
+ * @template T Type of the input value
487
+ * @returns A reusable `is` function
488
+ *
489
+ * @author Jeongho Nam - https://github.com/samchon
490
+ */
491
+ export function createIs<T>(): (input: unknown) => input is T;
492
+
493
+ /**
494
+ * @internal
495
+ */
496
+ export function createIs<T>(): (input: unknown) => input is T {
497
+ halt("createIs");
498
+ }
499
+ Object.assign(createIs, is);
500
+
501
+ /**
502
+ * Creates a reusable {@link validate} function.
503
+ *
504
+ * @danger You must configure the generic argument `T`
505
+ * @returns Nothing until you configure the generic argument `T`
506
+ * @throws compile error
507
+ *
508
+ * @author Jeongho Nam - https://github.com/samchon
509
+ */
510
+ export function createValidate(): never;
511
+
512
+ /**
513
+ * Creates a reusable {@link validate} function.
514
+ *
515
+ * @template T Type of the input value
516
+ * @returns A reusable `validate` function
517
+ *
518
+ * @author Jeongho Nam - https://github.com/samchon
519
+ */
520
+ export function createValidate<T>(): (input: unknown) => IValidation<T>;
521
+
522
+ /**
523
+ * @internal
524
+ */
525
+ export function createValidate(): (input: unknown) => IValidation {
526
+ halt("createValidate");
527
+ }
528
+ Object.assign(createValidate, validate);
529
+
530
+ /**
531
+ * Creates a reusable {@link assertEquals} function.
532
+ *
533
+ * @danger You must configure the generic argument `T`
534
+ * @returns Nothing until you configure the generic argument `T`
535
+ * @throws compile error
536
+ *
537
+ * @author Jeongho Nam - https://github.com/samchon
538
+ */
539
+ export function createAssertEquals(): never;
540
+
541
+ /**
542
+ * Creates a reusable {@link assertEquals} function.
543
+ *
544
+ * @template T Type of the input value
545
+ * @returns A reusable `assertEquals` function
546
+ *
547
+ * @author Jeongho Nam - https://github.com/samchon
548
+ */
549
+ export function createAssertEquals<T>(): (input: unknown) => T;
550
+
551
+ /**
552
+ * @internal
553
+ */
554
+ export function createAssertEquals<T>(): (input: unknown) => T {
555
+ halt("createAssertEquals");
556
+ }
557
+ Object.assign(createAssertEquals, assertEquals);
558
+
559
+ /**
560
+ * Creates a reusable {@link equals} function.
561
+ *
562
+ * @danger You must configure the generic argument `T`
563
+ * @returns Nothing until you configure the generic argument `T`
564
+ * @throws compile error
565
+ *
566
+ * @author Jeongho Nam - https://github.com/samchon
567
+ */
568
+ export function createEquals(): never;
569
+
570
+ /**
571
+ * Creates a reusable {@link equals} function.
572
+ *
573
+ * @template T Type of the input value
574
+ * @returns A reusable `equals` function
575
+ *
576
+ * @author Jeongho Nam - https://github.com/samchon
577
+ */
578
+ export function createEquals<T>(): (input: unknown) => input is T;
579
+
580
+ /**
581
+ * @internal
582
+ */
583
+ export function createEquals<T>(): (input: unknown) => input is T {
584
+ halt("createEquals");
585
+ }
586
+ Object.assign(createEquals, equals);
587
+
588
+ /**
589
+ * Creates a reusable {@link validateEquals} function.
590
+ *
591
+ * @danger You must configure the generic argument `T`
592
+ * @returns Nothing until you configure the generic argument `T`
593
+ * @throws compile error
594
+ *
595
+ * @author Jeongho Nam - https://github.com/samchon
596
+ */
597
+ export function createValidateEquals(): never;
598
+
599
+ /**
600
+ * Creates a reusable {@link validateEquals} function.
601
+ *
602
+ * @template T Type of the input value
603
+ * @returns A reusable `validateEquals` function
604
+ *
605
+ * @author Jeongho Nam - https://github.com/samchon
606
+ */
607
+ export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
608
+
609
+ /**
610
+ * @internal
611
+ */
612
+ export function createValidateEquals(): (input: unknown) => IValidation {
613
+ halt("createValidateEquals");
614
+ }
615
+ Object.assign(createValidateEquals, validateEquals);
616
+
617
+ /**
618
+ * Creates a reusable {@link random} function.
619
+ *
620
+ * @danger You must configure the generic argument `T`
621
+ * @param generator Random data generator
622
+ * @returns Nothing until you configure the generic argument `T`
623
+ * @throws compile error
624
+ *
625
+ * @author Jeongho Nam - https://github.com/samchon
626
+ */
627
+ export function createRandom(generator?: Partial<IRandomGenerator>): never;
628
+
629
+ /**
630
+ * Creates a resuable {@link random} function.
631
+ *
632
+ * @template T Type of the input value
633
+ * @param generator Random data generator
634
+ * @returns A reusable `random` function
635
+ *
636
+ * @author Jeongho Nam - https://github.com/samchon
637
+ */
638
+ export function createRandom<T>(
639
+ generator?: Partial<IRandomGenerator>,
640
+ ): () => Resolved<T>;
641
+
642
+ /**
643
+ * @internal
644
+ */
645
+ export function createRandom(): never {
646
+ halt("createRandom");
647
+ }
648
+ Object.assign(createRandom, random);
649
+
650
+ /**
651
+ * @internal
652
+ */
653
+ function halt(name: string): never {
654
+ throw new Error(
655
+ `Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
656
+ );
657
+ }