typia 5.4.14 → 5.5.0-dev.20240301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/factories/IdentifierFactory.d.ts +1 -1
- package/lib/functional/$guard.js +49 -28
- package/lib/functional/$guard.js.map +1 -1
- package/lib/functional/Namespace/index.d.ts +1 -1
- package/lib/http.d.ts +10 -493
- package/lib/http.js.map +1 -1
- package/lib/json.d.ts +9 -8
- package/lib/json.js.map +1 -1
- package/lib/misc.d.ts +9 -8
- package/lib/misc.js.map +1 -1
- package/lib/module.d.ts +17 -16
- package/lib/module.js.map +1 -1
- package/lib/notations.d.ts +13 -12
- package/lib/notations.js.map +1 -1
- package/lib/programmers/AssertProgrammer.d.ts +5 -1
- package/lib/programmers/AssertProgrammer.js +31 -22
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpAssertFormDataProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpAssertFormDataProgrammer.js +6 -2
- package/lib/programmers/http/HttpAssertFormDataProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpAssertHeadersProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpAssertHeadersProgrammer.js +6 -2
- package/lib/programmers/http/HttpAssertHeadersProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpAssertQueryProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpAssertQueryProgrammer.js +6 -2
- package/lib/programmers/http/HttpAssertQueryProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonAssertParseProgrammer.d.ts +1 -1
- package/lib/programmers/json/JsonAssertParseProgrammer.js +9 -3
- package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +1 -1
- package/lib/programmers/json/JsonAssertStringifyProgrammer.js +9 -3
- package/lib/programmers/json/JsonAssertStringifyProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscAssertCloneProgrammer.d.ts +1 -1
- package/lib/programmers/misc/MiscAssertCloneProgrammer.js +9 -3
- package/lib/programmers/misc/MiscAssertCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscAssertPruneProgrammer.d.ts +1 -1
- package/lib/programmers/misc/MiscAssertPruneProgrammer.js +9 -3
- package/lib/programmers/misc/MiscAssertPruneProgrammer.js.map +1 -1
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.d.ts +1 -1
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.js +9 -3
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.d.ts +1 -1
- package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.js +6 -2
- package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.d.ts +1 -1
- package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.js +9 -3
- package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.js.map +1 -1
- package/lib/protobuf.d.ts +9 -8
- package/lib/protobuf.js.map +1 -1
- package/lib/transformers/internal/GenericTransformer.d.ts +1 -1
- package/lib/transformers/internal/GenericTransformer.js +3 -3
- package/lib/transformers/internal/GenericTransformer.js.map +1 -1
- package/package.json +1 -1
- package/src/factories/IdentifierFactory.ts +1 -1
- package/src/functional/$guard.ts +33 -19
- package/src/http.ts +25 -508
- package/src/json.ts +29 -8
- package/src/misc.ts +29 -8
- package/src/module.ts +57 -16
- package/src/notations.ts +43 -12
- package/src/programmers/AssertProgrammer.ts +69 -28
- package/src/programmers/http/HttpAssertFormDataProgrammer.ts +6 -2
- package/src/programmers/http/HttpAssertHeadersProgrammer.ts +6 -2
- package/src/programmers/http/HttpAssertQueryProgrammer.ts +6 -2
- package/src/programmers/json/JsonAssertParseProgrammer.ts +9 -3
- package/src/programmers/json/JsonAssertStringifyProgrammer.ts +9 -3
- package/src/programmers/misc/MiscAssertCloneProgrammer.ts +9 -3
- package/src/programmers/misc/MiscAssertPruneProgrammer.ts +9 -3
- package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +9 -3
- package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +6 -2
- package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +9 -3
- package/src/protobuf.ts +29 -8
- package/src/transformers/internal/GenericTransformer.ts +12 -4
package/src/json.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { IJsonApplication } from "./schemas/json/IJsonApplication";
|
|
|
4
4
|
|
|
5
5
|
import { IValidation } from "./IValidation";
|
|
6
6
|
import { Primitive } from "./Primitive";
|
|
7
|
+
import { TypeGuardError } from "./TypeGuardError";
|
|
7
8
|
|
|
8
9
|
/* ===========================================================
|
|
9
10
|
JSON
|
|
@@ -103,7 +104,10 @@ export function application(): never {
|
|
|
103
104
|
*
|
|
104
105
|
* @author Jeongho Nam - https://github.com/samchon
|
|
105
106
|
*/
|
|
106
|
-
function assertParse(
|
|
107
|
+
function assertParse(
|
|
108
|
+
input: string,
|
|
109
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
110
|
+
): never;
|
|
107
111
|
|
|
108
112
|
/**
|
|
109
113
|
* Safe `JSON.parse()` function with type assertion.
|
|
@@ -122,7 +126,10 @@ function assertParse(input: string): never;
|
|
|
122
126
|
*
|
|
123
127
|
* @author Jeongho Nam - https://github.com/samchon
|
|
124
128
|
*/
|
|
125
|
-
function assertParse<T>(
|
|
129
|
+
function assertParse<T>(
|
|
130
|
+
input: string,
|
|
131
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
132
|
+
): Primitive<T>;
|
|
126
133
|
|
|
127
134
|
/**
|
|
128
135
|
* @internal
|
|
@@ -302,7 +309,10 @@ export { stringifyPure as stringify };
|
|
|
302
309
|
*
|
|
303
310
|
* @author Jeongho Nam - https://github.com/samchon
|
|
304
311
|
*/
|
|
305
|
-
function assertStringify<T>(
|
|
312
|
+
function assertStringify<T>(
|
|
313
|
+
input: T,
|
|
314
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
315
|
+
): string;
|
|
306
316
|
|
|
307
317
|
/**
|
|
308
318
|
* 5x faster `JSON.stringify()` function with type assertion.
|
|
@@ -325,7 +335,10 @@ function assertStringify<T>(input: T): string;
|
|
|
325
335
|
*
|
|
326
336
|
* @author Jeongho Nam - https://github.com/samchon
|
|
327
337
|
*/
|
|
328
|
-
function assertStringify<T>(
|
|
338
|
+
function assertStringify<T>(
|
|
339
|
+
input: T,
|
|
340
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
341
|
+
): unknown;
|
|
329
342
|
|
|
330
343
|
/**
|
|
331
344
|
* @internal
|
|
@@ -518,7 +531,9 @@ export { createIsParsePure as createIsParse };
|
|
|
518
531
|
*
|
|
519
532
|
* @author Jeongho Nam - https://github.com/samchon
|
|
520
533
|
*/
|
|
521
|
-
function createAssertParse(
|
|
534
|
+
function createAssertParse(
|
|
535
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
536
|
+
): never;
|
|
522
537
|
|
|
523
538
|
/**
|
|
524
539
|
* Creates a reusable {@link assertParse} function.
|
|
@@ -528,7 +543,9 @@ function createAssertParse(): never;
|
|
|
528
543
|
*
|
|
529
544
|
* @author Jeongho Nam - https://github.com/samchon
|
|
530
545
|
*/
|
|
531
|
-
function createAssertParse<T>(
|
|
546
|
+
function createAssertParse<T>(
|
|
547
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
548
|
+
): (input: string) => Primitive<T>;
|
|
532
549
|
|
|
533
550
|
/**
|
|
534
551
|
* @internal
|
|
@@ -621,7 +638,9 @@ export { createStringifyPure as createStringify };
|
|
|
621
638
|
*
|
|
622
639
|
* @author Jeongho Nam - https://github.com/samchon
|
|
623
640
|
*/
|
|
624
|
-
function createAssertStringify(
|
|
641
|
+
function createAssertStringify(
|
|
642
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
643
|
+
): never;
|
|
625
644
|
|
|
626
645
|
/**
|
|
627
646
|
* Creates a reusable {@link assertStringify} function.
|
|
@@ -631,7 +650,9 @@ function createAssertStringify(): never;
|
|
|
631
650
|
*
|
|
632
651
|
* @author Jeongho Nam - https://github.com/samchon
|
|
633
652
|
*/
|
|
634
|
-
function createAssertStringify<T>(
|
|
653
|
+
function createAssertStringify<T>(
|
|
654
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
655
|
+
): (input: unknown) => string;
|
|
635
656
|
|
|
636
657
|
/**
|
|
637
658
|
* @internal
|
package/src/misc.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { Atomic } from "./typings/Atomic";
|
|
|
13
13
|
|
|
14
14
|
import { IValidation } from "./IValidation";
|
|
15
15
|
import { Resolved } from "./Resolved";
|
|
16
|
+
import { TypeGuardError } from "./TypeGuardError";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* > You must configure the generic argument `T`.
|
|
@@ -107,7 +108,10 @@ export { clonePure as clone };
|
|
|
107
108
|
*
|
|
108
109
|
* @author Jeongho Nam - https://github.com/samchon
|
|
109
110
|
*/
|
|
110
|
-
function assertClone<T>(
|
|
111
|
+
function assertClone<T>(
|
|
112
|
+
input: T,
|
|
113
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
114
|
+
): Resolved<T>;
|
|
111
115
|
|
|
112
116
|
/**
|
|
113
117
|
* Clone a data with type assertion.
|
|
@@ -126,7 +130,10 @@ function assertClone<T>(input: T): Resolved<T>;
|
|
|
126
130
|
*
|
|
127
131
|
* @author Jeongho Nam - https://github.com/samchon
|
|
128
132
|
*/
|
|
129
|
-
function assertClone<T>(
|
|
133
|
+
function assertClone<T>(
|
|
134
|
+
input: unknown,
|
|
135
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
136
|
+
): Resolved<T>;
|
|
130
137
|
|
|
131
138
|
/**
|
|
132
139
|
* @internal
|
|
@@ -303,7 +310,10 @@ export { prunePure as prune };
|
|
|
303
310
|
*
|
|
304
311
|
* @author Jeongho Nam - https://github.com/samchon
|
|
305
312
|
*/
|
|
306
|
-
function assertPrune<T>(
|
|
313
|
+
function assertPrune<T>(
|
|
314
|
+
input: T,
|
|
315
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
316
|
+
): T;
|
|
307
317
|
|
|
308
318
|
/**
|
|
309
319
|
* Prune, erase superfluous properties, with type assertion.
|
|
@@ -321,7 +331,10 @@ function assertPrune<T>(input: T): T;
|
|
|
321
331
|
*
|
|
322
332
|
* @author Jeongho Nam - https://github.com/samchon
|
|
323
333
|
*/
|
|
324
|
-
function assertPrune<T>(
|
|
334
|
+
function assertPrune<T>(
|
|
335
|
+
input: unknown,
|
|
336
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
337
|
+
): T;
|
|
325
338
|
|
|
326
339
|
/**
|
|
327
340
|
* @internal
|
|
@@ -494,7 +507,9 @@ export { createClonePure as createClone };
|
|
|
494
507
|
*
|
|
495
508
|
* @author Jeongho Nam - https://github.com/samchon
|
|
496
509
|
*/
|
|
497
|
-
function createAssertClone(
|
|
510
|
+
function createAssertClone(
|
|
511
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
512
|
+
): never;
|
|
498
513
|
|
|
499
514
|
/**
|
|
500
515
|
* Creates a resuable {@link assertClone} function.
|
|
@@ -504,7 +519,9 @@ function createAssertClone(): never;
|
|
|
504
519
|
*
|
|
505
520
|
* @author Jeongho Nam - https://github.com/samchon
|
|
506
521
|
*/
|
|
507
|
-
function createAssertClone<T>(
|
|
522
|
+
function createAssertClone<T>(
|
|
523
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
524
|
+
): (input: unknown) => Resolved<T>;
|
|
508
525
|
|
|
509
526
|
/**
|
|
510
527
|
* @internal
|
|
@@ -626,7 +643,9 @@ export { createPrunePure as createPrune };
|
|
|
626
643
|
*
|
|
627
644
|
* @author Jeongho Nam - https://github.com/samchon
|
|
628
645
|
*/
|
|
629
|
-
function createAssertPrune(
|
|
646
|
+
function createAssertPrune(
|
|
647
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
648
|
+
): never;
|
|
630
649
|
|
|
631
650
|
/**
|
|
632
651
|
* Creates a resuable {@link assertPrune} function.
|
|
@@ -636,7 +655,9 @@ function createAssertPrune(): never;
|
|
|
636
655
|
*
|
|
637
656
|
* @author Jeongho Nam - https://github.com/samchon
|
|
638
657
|
*/
|
|
639
|
-
function createAssertPrune<T extends object>(
|
|
658
|
+
function createAssertPrune<T extends object>(
|
|
659
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
660
|
+
): (input: T) => T;
|
|
640
661
|
|
|
641
662
|
/**
|
|
642
663
|
* @internal
|
package/src/module.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { AssertionGuard } from "./AssertionGuard";
|
|
|
4
4
|
import { IRandomGenerator } from "./IRandomGenerator";
|
|
5
5
|
import { IValidation } from "./IValidation";
|
|
6
6
|
import { Resolved } from "./Resolved";
|
|
7
|
+
import { TypeGuardError } from "./TypeGuardError";
|
|
7
8
|
|
|
8
9
|
export * as http from "./http";
|
|
9
10
|
export * as json from "./json";
|
|
@@ -54,7 +55,10 @@ export * from "./SnakeCase";
|
|
|
54
55
|
*
|
|
55
56
|
* @author Jeongho Nam - https://github.com/samchon
|
|
56
57
|
*/
|
|
57
|
-
function assert<T>(
|
|
58
|
+
function assert<T>(
|
|
59
|
+
input: T,
|
|
60
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
61
|
+
): T;
|
|
58
62
|
|
|
59
63
|
/**
|
|
60
64
|
* Asserts a value type.
|
|
@@ -77,7 +81,10 @@ function assert<T>(input: T): T;
|
|
|
77
81
|
*
|
|
78
82
|
* @author Jeongho Nam - https://github.com/samchon
|
|
79
83
|
*/
|
|
80
|
-
function assert<T>(
|
|
84
|
+
function assert<T>(
|
|
85
|
+
input: unknown,
|
|
86
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
87
|
+
): T;
|
|
81
88
|
|
|
82
89
|
/**
|
|
83
90
|
* @internal
|
|
@@ -115,7 +122,10 @@ export { assertPure as assert };
|
|
|
115
122
|
*
|
|
116
123
|
* @author Jeongho Nam - https://github.com/samchon
|
|
117
124
|
*/
|
|
118
|
-
function assertGuard<T>(
|
|
125
|
+
function assertGuard<T>(
|
|
126
|
+
input: T,
|
|
127
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
128
|
+
): asserts input is T;
|
|
119
129
|
|
|
120
130
|
/**
|
|
121
131
|
* Assertion guard of a value type.
|
|
@@ -141,7 +151,10 @@ function assertGuard<T>(input: T): asserts input is T;
|
|
|
141
151
|
*
|
|
142
152
|
* @author Jeongho Nam - https://github.com/samchon
|
|
143
153
|
*/
|
|
144
|
-
function assertGuard<T>(
|
|
154
|
+
function assertGuard<T>(
|
|
155
|
+
input: unknown,
|
|
156
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
157
|
+
): asserts input is T;
|
|
145
158
|
|
|
146
159
|
/**
|
|
147
160
|
* @internal
|
|
@@ -303,7 +316,10 @@ export { validatePure as validate };
|
|
|
303
316
|
*
|
|
304
317
|
* @author Jeongho Nam - https://github.com/samchon
|
|
305
318
|
*/
|
|
306
|
-
function assertEquals<T>(
|
|
319
|
+
function assertEquals<T>(
|
|
320
|
+
input: T,
|
|
321
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
322
|
+
): T;
|
|
307
323
|
|
|
308
324
|
/**
|
|
309
325
|
* Asserts equality between a value and its type.
|
|
@@ -328,7 +344,10 @@ function assertEquals<T>(input: T): T;
|
|
|
328
344
|
*
|
|
329
345
|
* @author Jeongho Nam - https://github.com/samchon
|
|
330
346
|
*/
|
|
331
|
-
function assertEquals<T>(
|
|
347
|
+
function assertEquals<T>(
|
|
348
|
+
input: unknown,
|
|
349
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
350
|
+
): T;
|
|
332
351
|
|
|
333
352
|
/**
|
|
334
353
|
* @internal
|
|
@@ -369,7 +388,10 @@ export { assertEqualsPure as assertEquals };
|
|
|
369
388
|
*
|
|
370
389
|
* @author Jeongho Nam - https://github.com/samchon
|
|
371
390
|
*/
|
|
372
|
-
function assertGuardEquals<T>(
|
|
391
|
+
function assertGuardEquals<T>(
|
|
392
|
+
input: T,
|
|
393
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
394
|
+
): asserts input is T;
|
|
373
395
|
|
|
374
396
|
/**
|
|
375
397
|
* Assertion guard of a type with equality.
|
|
@@ -398,7 +420,10 @@ function assertGuardEquals<T>(input: T): asserts input is T;
|
|
|
398
420
|
*
|
|
399
421
|
* @author Jeongho Nam - https://github.com/samchon
|
|
400
422
|
*/
|
|
401
|
-
function assertGuardEquals<T>(
|
|
423
|
+
function assertGuardEquals<T>(
|
|
424
|
+
input: unknown,
|
|
425
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
426
|
+
): asserts input is T;
|
|
402
427
|
|
|
403
428
|
/**
|
|
404
429
|
* @internal
|
|
@@ -603,7 +628,9 @@ export { randomPure as random };
|
|
|
603
628
|
*
|
|
604
629
|
* @author Jeongho Nam - https://github.com/samchon
|
|
605
630
|
*/
|
|
606
|
-
function createAssert(
|
|
631
|
+
function createAssert(
|
|
632
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
633
|
+
): never;
|
|
607
634
|
|
|
608
635
|
/**
|
|
609
636
|
* Creates a reusable {@link assert} function.
|
|
@@ -613,7 +640,9 @@ function createAssert(): never;
|
|
|
613
640
|
*
|
|
614
641
|
* @author Jeongho Nam - https://github.com/samchon
|
|
615
642
|
*/
|
|
616
|
-
function createAssert<T>(
|
|
643
|
+
function createAssert<T>(
|
|
644
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
645
|
+
): (input: unknown) => T;
|
|
617
646
|
|
|
618
647
|
/**
|
|
619
648
|
* @internal
|
|
@@ -651,7 +680,9 @@ export { createAssertPure as createAssert };
|
|
|
651
680
|
*
|
|
652
681
|
* @author Jeongho Nam - https://github.com/samchon
|
|
653
682
|
*/
|
|
654
|
-
function createAssertGuard(
|
|
683
|
+
function createAssertGuard(
|
|
684
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
685
|
+
): never;
|
|
655
686
|
|
|
656
687
|
/**
|
|
657
688
|
* Creates a reusable {@link assertGuard} function.
|
|
@@ -676,7 +707,9 @@ function createAssertGuard(): never;
|
|
|
676
707
|
*
|
|
677
708
|
* @author Jeongho Nam - https://github.com/samchon
|
|
678
709
|
*/
|
|
679
|
-
function createAssertGuard<T>(
|
|
710
|
+
function createAssertGuard<T>(
|
|
711
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
712
|
+
): (input: unknown) => AssertionGuard<T>;
|
|
680
713
|
|
|
681
714
|
/**
|
|
682
715
|
* @internal
|
|
@@ -765,7 +798,9 @@ export { createValidatePure as createValidate };
|
|
|
765
798
|
*
|
|
766
799
|
* @author Jeongho Nam - https://github.com/samchon
|
|
767
800
|
*/
|
|
768
|
-
function createAssertEquals(
|
|
801
|
+
function createAssertEquals(
|
|
802
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
803
|
+
): never;
|
|
769
804
|
|
|
770
805
|
/**
|
|
771
806
|
* Creates a reusable {@link assertEquals} function.
|
|
@@ -775,7 +810,9 @@ function createAssertEquals(): never;
|
|
|
775
810
|
*
|
|
776
811
|
* @author Jeongho Nam - https://github.com/samchon
|
|
777
812
|
*/
|
|
778
|
-
function createAssertEquals<T>(
|
|
813
|
+
function createAssertEquals<T>(
|
|
814
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
815
|
+
): (input: unknown) => T;
|
|
779
816
|
|
|
780
817
|
/**
|
|
781
818
|
* @internal
|
|
@@ -813,7 +850,9 @@ export { createAssertEqualsPure as createAssertEquals };
|
|
|
813
850
|
*
|
|
814
851
|
* @author Jeongho Nam - https://github.com/samchon
|
|
815
852
|
*/
|
|
816
|
-
function createAssertGuardEquals(
|
|
853
|
+
function createAssertGuardEquals(
|
|
854
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
855
|
+
): never;
|
|
817
856
|
|
|
818
857
|
/**
|
|
819
858
|
* Creates a reusable {@link assertGuardEquals} function.
|
|
@@ -838,7 +877,9 @@ function createAssertGuardEquals(): never;
|
|
|
838
877
|
*
|
|
839
878
|
* @author Jeongho Nam - https://github.com/samchon
|
|
840
879
|
*/
|
|
841
|
-
function createAssertGuardEquals<T>(
|
|
880
|
+
function createAssertGuardEquals<T>(
|
|
881
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
882
|
+
): (input: unknown) => AssertionGuard<T>;
|
|
842
883
|
|
|
843
884
|
/**
|
|
844
885
|
* @internal
|
package/src/notations.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { CamelCase } from "./CamelCase";
|
|
|
4
4
|
import { IValidation } from "./IValidation";
|
|
5
5
|
import { PascalCase } from "./PascalCase";
|
|
6
6
|
import { SnakeCase } from "./SnakeCase";
|
|
7
|
+
import { TypeGuardError } from "./TypeGuardError";
|
|
7
8
|
|
|
8
9
|
/* ===========================================================
|
|
9
10
|
NOTATIONS (NAMING CONVENTIONS)
|
|
@@ -59,7 +60,10 @@ export { camelPure as camel };
|
|
|
59
60
|
*
|
|
60
61
|
* @author Jeongho Nam - https://github.com/samchon
|
|
61
62
|
*/
|
|
62
|
-
function assertCamel<T>(
|
|
63
|
+
function assertCamel<T>(
|
|
64
|
+
input: T,
|
|
65
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
66
|
+
): CamelCase<T>;
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
69
|
* Converts to camel case with type assertion.
|
|
@@ -73,7 +77,10 @@ function assertCamel<T>(input: T): CamelCase<T>;
|
|
|
73
77
|
*
|
|
74
78
|
* @author Jeongho Nam - https://github.com/samchon
|
|
75
79
|
*/
|
|
76
|
-
function assertCamel<T>(
|
|
80
|
+
function assertCamel<T>(
|
|
81
|
+
input: unknown,
|
|
82
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
83
|
+
): CamelCase<T>;
|
|
77
84
|
|
|
78
85
|
/**
|
|
79
86
|
* @internal
|
|
@@ -230,7 +237,10 @@ export { pascalPure as pascal };
|
|
|
230
237
|
*
|
|
231
238
|
* @author Jeongho Nam - https://github.com/samchon
|
|
232
239
|
*/
|
|
233
|
-
function assertPascal<T>(
|
|
240
|
+
function assertPascal<T>(
|
|
241
|
+
input: T,
|
|
242
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
243
|
+
): PascalCase<T>;
|
|
234
244
|
|
|
235
245
|
/**
|
|
236
246
|
* Converts to pascal case with type assertion.
|
|
@@ -244,7 +254,10 @@ function assertPascal<T>(input: T): PascalCase<T>;
|
|
|
244
254
|
*
|
|
245
255
|
* @author Jeongho Nam - https://github.com/samchon
|
|
246
256
|
*/
|
|
247
|
-
function assertPascal<T>(
|
|
257
|
+
function assertPascal<T>(
|
|
258
|
+
input: unknown,
|
|
259
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
260
|
+
): PascalCase<T>;
|
|
248
261
|
|
|
249
262
|
/**
|
|
250
263
|
* @internal
|
|
@@ -401,7 +414,10 @@ export { snakePure as snake };
|
|
|
401
414
|
*
|
|
402
415
|
* @author Jeongho Nam - https://github.com/samchon
|
|
403
416
|
*/
|
|
404
|
-
function assertSnake<T>(
|
|
417
|
+
function assertSnake<T>(
|
|
418
|
+
input: T,
|
|
419
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
420
|
+
): SnakeCase<T>;
|
|
405
421
|
|
|
406
422
|
/**
|
|
407
423
|
* Converts to snake case with type assertion.
|
|
@@ -415,7 +431,10 @@ function assertSnake<T>(input: T): SnakeCase<T>;
|
|
|
415
431
|
*
|
|
416
432
|
* @author Jeongho Nam - https://github.com/samchon
|
|
417
433
|
*/
|
|
418
|
-
function assertSnake<T>(
|
|
434
|
+
function assertSnake<T>(
|
|
435
|
+
input: unknown,
|
|
436
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
437
|
+
): SnakeCase<T>;
|
|
419
438
|
|
|
420
439
|
/**
|
|
421
440
|
* @internal
|
|
@@ -568,7 +587,9 @@ export { createCamelPure as createCamel };
|
|
|
568
587
|
*
|
|
569
588
|
* @author Jeongho Nam - https://github.com/samchon
|
|
570
589
|
*/
|
|
571
|
-
function createAssertCamel(
|
|
590
|
+
function createAssertCamel(
|
|
591
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
592
|
+
): never;
|
|
572
593
|
|
|
573
594
|
/**
|
|
574
595
|
* Creates a reusable {@link assertCamel} function.
|
|
@@ -578,7 +599,9 @@ function createAssertCamel(): never;
|
|
|
578
599
|
*
|
|
579
600
|
* @author Jeongho Nam - https://github.com/samchon
|
|
580
601
|
*/
|
|
581
|
-
function createAssertCamel<T>(
|
|
602
|
+
function createAssertCamel<T>(
|
|
603
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
604
|
+
): (input: T) => CamelCase<T>;
|
|
582
605
|
|
|
583
606
|
/**
|
|
584
607
|
* @internal
|
|
@@ -715,7 +738,9 @@ export { createPascalPure as createPascal };
|
|
|
715
738
|
*
|
|
716
739
|
* @author Jeongho Nam - https://github.com/samchon
|
|
717
740
|
*/
|
|
718
|
-
function createAssertPascal(
|
|
741
|
+
function createAssertPascal(
|
|
742
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
743
|
+
): never;
|
|
719
744
|
|
|
720
745
|
/**
|
|
721
746
|
* Creates a reusable {@link assertPascal} function.
|
|
@@ -725,7 +750,9 @@ function createAssertPascal(): never;
|
|
|
725
750
|
*
|
|
726
751
|
* @author Jeongho Nam - https://github.com/samchon
|
|
727
752
|
*/
|
|
728
|
-
function createAssertPascal<T>(
|
|
753
|
+
function createAssertPascal<T>(
|
|
754
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
755
|
+
): (input: T) => PascalCase<T>;
|
|
729
756
|
|
|
730
757
|
/**
|
|
731
758
|
* @internal
|
|
@@ -862,7 +889,9 @@ export { createSnakePure as createSnake };
|
|
|
862
889
|
*
|
|
863
890
|
* @author Jeongho Nam - https://github.com/samchon
|
|
864
891
|
*/
|
|
865
|
-
function createAssertSnake(
|
|
892
|
+
function createAssertSnake(
|
|
893
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
894
|
+
): never;
|
|
866
895
|
|
|
867
896
|
/**
|
|
868
897
|
* Creates a reusable {@link assertSnake} function.
|
|
@@ -872,7 +901,9 @@ function createAssertSnake(): never;
|
|
|
872
901
|
*
|
|
873
902
|
* @author Jeongho Nam - https://github.com/samchon
|
|
874
903
|
*/
|
|
875
|
-
function createAssertSnake<T>(
|
|
904
|
+
function createAssertSnake<T>(
|
|
905
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
906
|
+
): (input: T) => SnakeCase<T>;
|
|
876
907
|
|
|
877
908
|
/**
|
|
878
909
|
* @internal
|