-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
json.ts
738 lines (684 loc) · 23.6 KB
/
json.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
import * as Namespace from "./functional/Namespace";
import { IJsonApplication } from "./schemas/json/IJsonApplication";
import { IValidation } from "./IValidation";
import { Primitive } from "./Primitive";
import { TypeGuardError } from "./TypeGuardError";
/* ===========================================================
JSON
- SCHEMA
- PARSE
- STRINGIFY
- FACTORY FUNCTIONS
==============================================================
SCHEMA
----------------------------------------------------------- */
/**
* > You must configure the generic argument `Types`.
*
* JSON Schema Application.
*
* Creates a JSON schema application which contains both main JSON schemas and
* components. Note that, all of the named types are stored in the
* {@link IJsonApplication.components} property for the `$ref` referencing.
*
* Also, you can specify the OpenAPI version by configuring the second generic
* argument `Version`. For reference, the default version is `"3.1"`, and key
* different of `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
*
* @template Types Tuple of target types
* @template Purpose Purpose of the JSON schema
* @template Surplus Allow surplus properties starting with `x-typia-` or not
* @return JSON schema application
*
* @author Jeongho Nam - https://github.com/samchon
*/
export function application(): never;
/**
* JSON Schema Application.
*
* Creates a JSON schema application which contains both main JSON schemas and
* components. Note that, all of the named types are stored in the
* {@link IJsonApplication.components} property for the `$ref` referencing.
*
* Also, you can specify the OpenAPI version by configuring the second generic
* argument `Version`. For reference, the default version is `"3.1"`, and key
* different of `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
*
* @template Types Tuple of target types
* @template Version Version of OpenAPI specification. Default is 3.1
* @return JSON schema application
*
* @author Jeongho Nam - https://github.com/samchon
*/
export function application<
Types extends unknown[],
Version extends "3.0" | "3.1" = "3.1",
>(): IJsonApplication<Version>;
/**
* @internal
*/
export function application(): never {
halt("application");
}
/* -----------------------------------------------------------
PARSE
----------------------------------------------------------- */
/**
* > You must configure the generic argument `T`.
*
* Safe `JSON.parse()` function with type assertion.
*
* `typia.json.assertParse()` is a combination function of `JSON.parse()` and
* {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
* to a `T` typed instance with type assertion.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
* throws {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
* there's no problem on the parsed value, the parsed value would be returned.
*
* @template T Expected type of parsed value
* @param input JSON string
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @returns Parsed value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function assertParse(
input: string,
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): never;
/**
* Safe `JSON.parse()` function with type assertion.
*
* `typia.json.assertParse()` is a combination function of `JSON.parse()` and
* {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
* to a `T` typed instance with type assertion.
*
* In such reason, when parsed JSON string value is not matched with the type `T`,
* it throws {@link TypeGuardError} or custom error generated by *errorFactory*.
* Otherwise, there's no problem on the parsed value, the parsed value would be
* returned.
*
* @template T Expected type of parsed value
* @param input JSON string
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @returns Parsed value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function assertParse<T>(
input: string,
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): Primitive<T>;
/**
* @internal
*/
function assertParse<T>(): Primitive<T> {
halt("assertParse");
}
const assertParsePure = /** @__PURE__ */ Object.assign<typeof assertParse, {}>(
assertParse,
/** @__PURE__ */ Namespace.assert("json.assertParse"),
);
export { assertParsePure as assertParse };
/**
* > You must configure the generic argument `T`.
*
* Safe `JSON.parse()` function with type checking.
*
* `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
* instance with type checking.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
* value would be returned.
*
* @template T Expected type of parsed value
* @param input JSON string
* @returns Parsed value when exact type, otherwise `null`
*
* @author Jeongho Nam - https://github.com/samchon
*/
function isParse(input: string): never;
/**
* Safe `JSON.parse()` function with type checking.
*
* `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
* instance with type checking.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
* value would be returned.
*
* @template T Expected type of parsed value
* @param input JSON string
* @returns Parsed value when exact type, otherwise `null`
*
* @author Jeongho Nam - https://github.com/samchon
*/
function isParse<T>(input: string): Primitive<T> | null;
/**
* @internal
*/
function isParse<T>(): Primitive<T> | null {
halt("isParse");
}
const isParsePure = /** @__PURE__ */ Object.assign<typeof isParse, {}>(
isParse,
/** @__PURE__ */ Namespace.is(),
);
export { isParsePure as isParse };
/**
* > You must configure the generic argument `T`.
*
* Safe `JSON.parse()` function with detailed type validation.
*
* `typia.json.validateParse()` is a combination function of `JSON.parse()` and
* {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
* to a `T` typed instance with detailed type validation.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
* there's no problem on the parsed value, the parsed value would be stored in `data`
* property of the output {@link IValidation.ISuccess} instance.
*
* @template T Expected type of parsed value
* @param input JSON string
* @returns Validation result with JSON parsed value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function validateParse(input: string): never;
/**
* Safe `JSON.parse()` function with detailed type validation.
*
* `typia.json.validateParse()` is a combination function of `JSON.parse()` and
* {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
* to a `T` typed instance with detailed type validation.
*
* In such reason, when parsed JSON string value is not matched with the type `T`, it
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
* there's no problem on the parsed value, the parsed value would be stored in `data`
* property of the output {@link IValidation.ISuccess} instance.
*
* @template T Expected type of parsed value
* @param input JSON string
* @returns Validation result with JSON parsed value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function validateParse<T>(input: string): IValidation<Primitive<T>>;
/**
* @internal
*/
function validateParse<T>(): IValidation<Primitive<T>> {
halt("validateParse");
}
const validateParsePure = /** @__PURE__ */ Object.assign<
typeof validateParse,
{}
>(validateParse, /** @__PURE__ */ Namespace.validate());
export { validateParsePure as validateParse };
/* -----------------------------------------------------------
STRINGIFY
----------------------------------------------------------- */
/**
* 8x faster `JSON.stringify()` function.
*
* Converts an input value to a JSON (JavaScript Object Notation) string, about 8x
* faster than the native `JSON.stringify()` function. The 5x faster principle is
* because it writes an optimized JSON conversion plan, only for the type `T`.
*
* For reference, this `typia.json.stringify()` does not validate the input value type.
* It just believes that the input value is following the type `T`. Therefore, if you
* can't ensure the input value type, it would be better to call one of below
* functions instead.
*
* - {@link assertStringify}
* - {@link isStringify}
* - {@link validateStringify}
*
* @template T Type of the input value
* @param input A value to be converted
* @return JSON string value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function stringify<T>(input: T): string;
/**
* @internal
*/
function stringify(): never {
halt("stringify");
}
const stringifyPure = /** @__PURE__ */ Object.assign<typeof stringify, {}>(
stringify,
/** @__PURE__ */ Namespace.json.stringify("stringify"),
);
export { stringifyPure as stringify };
/**
* 5x faster `JSON.stringify()` function with type assertion.
*
* `typia.json.assertStringify()` is a combination function of {@link assert} and
* {@link stringify}. Therefore, it converts an input value to
* JSON (JavaScript Object Notation) string, with type assertion.
*
* In such reason, when `input` value is not matched with the type `T`, it throws an
* {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
* there's no problem on the `input` value, JSON string would be returned.
*
* For reference, with type assertion, it is even 5x times faster than the native
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
* with confidence.
*
* @template T Type of the input value
* @param input A value to be asserted and converted
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @return JSON string value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function assertStringify<T>(
input: T,
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): string;
/**
* 5x faster `JSON.stringify()` function with type assertion.
*
* `typia.json.assertStringify()` is a combination function of {@link assert} and
* {@link stringify}. Therefore, it converts an input value to
* JSON (JavaScript Object Notation) string, with type assertion.
*
* In such reason, when `input` value is not matched with the type `T`, it throws an
* {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
* there's no problem on the `input` value, JSON string would be returned.
*
* For reference, with type assertion, it is even 5x times faster than the native
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
* with confidence.
*
* @template T Type of the input value
* @param input A value to be asserted and converted
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @return JSON string value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function assertStringify<T>(
input: T,
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): unknown;
/**
* @internal
*/
function assertStringify(): string {
halt("assertStringify");
}
const assertStringifyPure = /** @__PURE__ */ Object.assign<
typeof assertStringify,
{},
{}
>(
assertStringify,
/** @__PURE__ */ Namespace.assert("json.assertStringify"),
/** @__PURE__ */ Namespace.json.stringify("assertStringify"),
);
export { assertStringifyPure as assertStringify };
/**
* 7x faster `JSON.stringify()` function with type checking.
*
* `typia.json.stringify()` is a combination function of {@link is} and
* {@link stringify}. Therefore, it converts an input value to JSON
* (JavaScript Object Notation) string, with type checking.
*
* In such reason, when `input` value is not matched with the type `T`, it returns
* `null` value. Otherwise, there's no problem on the `input` value, JSON string
* would be returned.
*
* For reference, with type checking, it is even 7x times faster than the native
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
* with confidence.
*
* @template T Type of the input value
* @param input A value to be checked and converted
* @return JSON string value when exact type, otherwise null
*
* @author Jeongho Nam - https://github.com/samchon
*/
function isStringify<T>(input: T): string | null;
/**
* 7x faster `JSON.stringify()` function with type checking.
*
* `typia.json.isStringify()` is a combination function of {@link is} and
* {@link stringify}. Therefore, it converts an input value to JSON
* (JavaScript Object Notation) string, with type checking.
*
* In such reason, when `input` value is not matched with the type `T`, it returns
* `null` value. Otherwise, there's no problem on the `input` value, JSON string
* would be returned.
*
* For reference, with type checking, it is even 7x times faster than the native
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
* with confidence.
*
* @template T Type of the input value
* @param input A value to be checked and converted
* @return JSON string value when exact type, otherwise null
*
* @author Jeongho Nam - https://github.com/samchon
*/
function isStringify<T>(input: unknown): string | null;
/**
* @internal
*/
function isStringify(): string | null {
halt("isStringify");
}
const isStringifyPure = /** @__PURE__ */ Object.assign<
typeof isStringify,
{},
{}
>(
isStringify,
/** @__PURE__ */ Namespace.is(),
/** @__PURE__ */ Namespace.json.stringify("isStringify"),
);
export { isStringifyPure as isStringify };
/**
* 5x faster `JSON.stringify()` function with detailed type validation.
*
* `typia.json.validateStringify()` is a combination function of {@link validate} and
* {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
* Notation) string, with detailed type validation.
*
* In such reason, when `input` value is not matched with the type `T`, it returns
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
* there's no problem on the `input` value, JSON string would be stored in `data`
* property of the output {@link IValidation.ISuccess} instance.
*
* For reference, with detailed type validation, it is even 5x times faster than the
* native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
* conversion with confidence.
*
* @template T Type of the input value
* @param input A value to be checked and converted
* @returns Validation result with JSON string value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function validateStringify<T>(input: T): IValidation<string>;
/**
* 5x faster `JSON.stringify()` function with detailed type validation.
*
* `typia.json.validateStringify()` is a combination function of {@link validate} and
* {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
* Notation) string, with detailed type validation.
*
* In such reason, when `input` value is not matched with the type `T`, it returns
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
* there's no problem on the `input` value, JSON string would be stored in `data`
* property of the output {@link IValidation.ISuccess} instance.
*
* For reference, with detailed type validation, it is even 5x times faster than the
* native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
* conversion with confidence.
*
* @template T Type of the input value
* @param input A value to be checked and converted
* @returns Validation result with JSON string value
*
* @author Jeongho Nam - https://github.com/samchon
*/
function validateStringify<T>(input: unknown): IValidation<string>;
/**
* @internal
*/
function validateStringify(): IValidation<string> {
halt("validateStringify");
}
const validateStringifyPure = /** @__PURE__ */ Object.assign<
typeof validateStringify,
{},
{}
>(
validateStringify,
/** @__PURE__ */ Namespace.validate(),
/** @__PURE__ */ Namespace.json.stringify("validateStringify"),
);
export { validateStringifyPure as validateStringify };
/* -----------------------------------------------------------
FACTORY FUNCTIONS
----------------------------------------------------------- */
/**
* Creates a reusable {@link isParse} function.
*
* @danger You must configure the generic argument `T`
* @returns Nothing until you configure the generic argument `T`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createIsParse(): never;
/**
* Creates a reusable {@link isParse} function.
*
* @template T Expected type of parsed value
* @returns A reusable `isParse` function
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createIsParse<T>(): (input: string) => Primitive<T> | null;
/**
* @internal
*/
function createIsParse<T>(): (input: string) => Primitive<T> | null {
halt("createIsParse");
}
const createIsParsePure = /** @__PURE__ */ Object.assign<
typeof createIsParse,
{}
>(createIsParse, isParsePure);
export { createIsParsePure as createIsParse };
/**
* Creates a reusable {@link assertParse} function.
*
* @danger You must configure the generic argument `T`
* @returns Nothing until you configure the generic argument `T`
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createAssertParse(
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): never;
/**
* Creates a reusable {@link assertParse} function.
*
* @template T Expected type of parsed value
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @returns A reusable `assertParse` function
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createAssertParse<T>(
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): (input: string) => Primitive<T>;
/**
* @internal
*/
function createAssertParse<T>(): (input: string) => Primitive<T> {
halt("createAssertParse");
}
const createAssertParsePure = /** @__PURE__ */ Object.assign<
typeof createAssertParse,
{}
>(createAssertParse, assertParsePure);
export { createAssertParsePure as createAssertParse };
/**
* Creates a reusable {@link validateParse} function.
*
* @danger You must configure the generic argument `T`
* @returns Nothing until you configure the generic argument `T`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createValidateParse(): never;
/**
* Creates a reusable {@link validateParse} function.
*
* @template T Expected type of parsed value
* @returns A reusable `validateParse` function
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createValidateParse<T>(): (input: string) => IValidation<Primitive<T>>;
/**
* @internal
*/
function createValidateParse<T>(): (
input: string,
) => IValidation<Primitive<T>> {
halt("createValidateParse");
}
const createValidateParsePure = /** @__PURE__ */ Object.assign<
typeof createValidateParse,
{}
>(createValidateParse, validateParsePure);
export { createValidateParsePure as createValidateParse };
/**
* Creates a reusable {@link stringify} function.
*
* @danger You must configure the generic argument `T`
* @returns Nothing until you configure the generic argument `T`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createStringify(): never;
/**
* Creates a reusable {@link stringify} function.
*
* @template T Type of the input value
* @returns A reusable `stringify` function
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createStringify<T>(): (input: T) => string;
/**
* @internal
*/
function createStringify<T>(): (input: T) => string {
halt("createStringify");
}
const createStringifyPure = /** @__PURE__ */ Object.assign<
typeof createStringify,
{}
>(createStringify, stringifyPure);
export { createStringifyPure as createStringify };
/**
* Creates a reusable {@link assertStringify} function.
*
* @danger You must configure the generic argument `T`
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @returns Nothing until you configure the generic argument `T`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createAssertStringify(
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): never;
/**
* Creates a reusable {@link assertStringify} function.
*
* @template T Type of the input value
* @param errorFactory Custom error factory. Default is `TypeGuardError`
* @returns A reusable `assertStringify` function
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createAssertStringify<T>(
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
): (input: unknown) => string;
/**
* @internal
*/
function createAssertStringify(): (input: unknown) => string {
halt("createAssertStringify");
}
const createAssertStringifyPure = /** @__PURE__ */ Object.assign<
typeof createAssertStringify,
{}
>(createAssertStringify, assertStringifyPure);
export { createAssertStringifyPure as createAssertStringify };
/**
* Creates a reusable {@link isStringify} function.
*
* @danger You must configure the generic argument `T`
* @returns Nothing until you configure the generic argument `T`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createIsStringify(): never;
/**
* Creates a reusable {@link isStringify} function.
*
* @template T Type of the input value
* @returns A reusable `isStringify` function
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createIsStringify<T>(): (input: unknown) => string | null;
/**
* @internal
*/
function createIsStringify(): (input: unknown) => string | null {
halt("createIsStringify");
}
const createIsStringifyPure = /** @__PURE__ */ Object.assign<
typeof createIsStringify,
{}
>(createIsStringify, isStringifyPure);
export { createIsStringifyPure as createIsStringify };
/**
* Creates a reusable {@link validateStringify} function.
*
* @danger You must configure the generic argument `T`
* @returns Nothing until you configure the generic argument `T`
* @throws compile error
*
* @author Jeongho Nam - https://github.com/samchon
*/
function createValidateStringify(): never;
/**
* Creates a reusable {@link validateStringify} function.
*
* @template T Type of the input value
* @returns A reusable `validateStringify` function
* @author Jeongho Nam - https://github.com/samchon
*/
function createValidateStringify<T>(): (input: unknown) => IValidation<string>;
/**
* @internal
*/
function createValidateStringify(): (input: unknown) => IValidation<string> {
halt("createValidateStringify");
}
const createValidateStringifyPure = /** @__PURE__ */ Object.assign<
typeof createValidateStringify,
{}
>(createValidateStringify, validateStringifyPure);
export { createValidateStringifyPure as createValidateStringify };
/**
* @internal
*/
function halt(name: string): never {
throw new Error(
`Error on typia.json.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
);
}