@nestia/core 4.3.0 → 4.4.0-dev.20241216-2

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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +87 -87
  3. package/lib/decorators/TypedParam.d.ts +1 -1
  4. package/lib/decorators/TypedParam.js +12 -7
  5. package/lib/decorators/TypedParam.js.map +1 -1
  6. package/lib/options/INestiaTransformOptions.d.ts +6 -2
  7. package/lib/programmers/TypedParamProgrammer.js +8 -0
  8. package/lib/programmers/TypedParamProgrammer.js.map +1 -1
  9. package/package.json +6 -6
  10. package/src/adaptors/WebSocketAdaptor.ts +426 -426
  11. package/src/decorators/DynamicModule.ts +43 -43
  12. package/src/decorators/EncryptedBody.ts +101 -101
  13. package/src/decorators/EncryptedController.ts +38 -38
  14. package/src/decorators/EncryptedModule.ts +100 -100
  15. package/src/decorators/EncryptedRoute.ts +219 -219
  16. package/src/decorators/NoTransformConfigurationError.ts +32 -32
  17. package/src/decorators/PlainBody.ts +79 -79
  18. package/src/decorators/SwaggerCustomizer.ts +115 -115
  19. package/src/decorators/SwaggerExample.ts +100 -100
  20. package/src/decorators/TypedBody.ts +59 -59
  21. package/src/decorators/TypedException.ts +128 -128
  22. package/src/decorators/TypedFormData.ts +195 -195
  23. package/src/decorators/TypedHeaders.ts +64 -64
  24. package/src/decorators/TypedParam.ts +77 -66
  25. package/src/decorators/TypedQuery.ts +245 -245
  26. package/src/decorators/TypedRoute.ts +214 -214
  27. package/src/decorators/WebSocketRoute.ts +242 -242
  28. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  29. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  30. package/src/decorators/internal/NoTransformConfigureError.ts +2 -2
  31. package/src/decorators/internal/get_path_and_querify.ts +108 -108
  32. package/src/decorators/internal/get_path_and_stringify.ts +122 -122
  33. package/src/decorators/internal/get_text_body.ts +20 -20
  34. package/src/decorators/internal/headers_to_object.ts +13 -13
  35. package/src/decorators/internal/is_request_body_undefined.ts +14 -14
  36. package/src/decorators/internal/load_controller.ts +49 -49
  37. package/src/decorators/internal/route_error.ts +45 -45
  38. package/src/decorators/internal/validate_request_body.ts +74 -74
  39. package/src/decorators/internal/validate_request_form_data.ts +77 -77
  40. package/src/decorators/internal/validate_request_headers.ts +86 -86
  41. package/src/decorators/internal/validate_request_query.ts +74 -74
  42. package/src/index.ts +5 -5
  43. package/src/module.ts +21 -21
  44. package/src/options/INestiaTransformOptions.ts +29 -24
  45. package/src/options/INestiaTransformProject.ts +8 -8
  46. package/src/options/IRequestBodyValidator.ts +20 -20
  47. package/src/options/IRequestFormDataProps.ts +27 -27
  48. package/src/options/IRequestHeadersValidator.ts +22 -22
  49. package/src/options/IRequestQueryValidator.ts +20 -20
  50. package/src/options/IResponseBodyQuerifier.ts +25 -25
  51. package/src/options/IResponseBodyStringifier.ts +30 -30
  52. package/src/programmers/PlainBodyProgrammer.ts +70 -70
  53. package/src/programmers/TypedBodyProgrammer.ts +132 -132
  54. package/src/programmers/TypedFormDataBodyProgrammer.ts +118 -118
  55. package/src/programmers/TypedHeadersProgrammer.ts +63 -63
  56. package/src/programmers/TypedParamProgrammer.ts +33 -30
  57. package/src/programmers/TypedQueryBodyProgrammer.ts +63 -63
  58. package/src/programmers/TypedQueryProgrammer.ts +65 -65
  59. package/src/programmers/TypedQueryRouteProgrammer.ts +56 -56
  60. package/src/programmers/TypedRouteProgrammer.ts +76 -76
  61. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +72 -72
  62. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +75 -75
  63. package/src/programmers/http/HttpQuerifyProgrammer.ts +108 -108
  64. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +76 -76
  65. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  66. package/src/transform.ts +35 -35
  67. package/src/transformers/FileTransformer.ts +110 -110
  68. package/src/transformers/MethodTransformer.ts +103 -103
  69. package/src/transformers/NodeTransformer.ts +23 -23
  70. package/src/transformers/ParameterDecoratorTransformer.ts +143 -143
  71. package/src/transformers/ParameterTransformer.ts +57 -57
  72. package/src/transformers/TypedRouteTransformer.ts +85 -85
  73. package/src/transformers/WebSocketRouteTransformer.ts +120 -120
  74. package/src/typings/Creator.ts +3 -3
  75. package/src/typings/get-function-location.d.ts +7 -7
  76. package/src/utils/ArrayUtil.ts +7 -7
  77. package/src/utils/ExceptionManager.ts +112 -112
  78. package/src/utils/Singleton.ts +20 -20
  79. package/src/utils/SourceFinder.ts +57 -57
  80. package/src/utils/VersioningStrategy.ts +27 -27
@@ -1,74 +1,74 @@
1
- import { BadRequestException } from "@nestjs/common";
2
- import typia, { IValidation, TypeGuardError } from "typia";
3
-
4
- import { IRequestQueryValidator } from "../../options/IRequestQueryValidator";
5
- import { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
-
7
- /**
8
- * @internal
9
- */
10
- export const validate_request_query =
11
- (method: string) =>
12
- <T>(validator?: IRequestQueryValidator<T>) => {
13
- if (!validator) {
14
- NoTransformConfigurationError(method);
15
- return (input: URLSearchParams) =>
16
- Object.fromEntries(input.entries()) as T;
17
- } else if (validator.type === "assert") return assert(validator.assert);
18
- else if (validator.type === "is") return is(validator.is);
19
- else if (validator.type === "validate") return validate(validator.validate);
20
- return () =>
21
- new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
22
- };
23
-
24
- /**
25
- * @internal
26
- */
27
- const assert =
28
- <T>(closure: (input: URLSearchParams) => T) =>
29
- (input: URLSearchParams): T | BadRequestException => {
30
- try {
31
- return closure(input);
32
- } catch (exp) {
33
- if (typia.is<TypeGuardError>(exp)) {
34
- return new BadRequestException({
35
- path: exp.path,
36
- reason: exp.message,
37
- expected: exp.expected,
38
- value: exp.value,
39
- message: MESSAGE,
40
- });
41
- }
42
- throw exp;
43
- }
44
- };
45
-
46
- /**
47
- * @internal
48
- */
49
- const is =
50
- <T>(closure: (input: URLSearchParams) => T | null) =>
51
- (input: URLSearchParams): T | BadRequestException => {
52
- const result: T | null = closure(input);
53
- return result !== null ? result : new BadRequestException(MESSAGE);
54
- };
55
-
56
- /**
57
- * @internal
58
- */
59
- const validate =
60
- <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
61
- (input: URLSearchParams): T | BadRequestException => {
62
- const result: IValidation<T> = closure(input);
63
- return result.success
64
- ? result.data
65
- : new BadRequestException({
66
- errors: result.errors,
67
- message: MESSAGE,
68
- });
69
- };
70
-
71
- /**
72
- * @internal
73
- */
74
- const MESSAGE = "Request query data is not following the promised type.";
1
+ import { BadRequestException } from "@nestjs/common";
2
+ import typia, { IValidation, TypeGuardError } from "typia";
3
+
4
+ import { IRequestQueryValidator } from "../../options/IRequestQueryValidator";
5
+ import { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
+
7
+ /**
8
+ * @internal
9
+ */
10
+ export const validate_request_query =
11
+ (method: string) =>
12
+ <T>(validator?: IRequestQueryValidator<T>) => {
13
+ if (!validator) {
14
+ NoTransformConfigurationError(method);
15
+ return (input: URLSearchParams) =>
16
+ Object.fromEntries(input.entries()) as T;
17
+ } else if (validator.type === "assert") return assert(validator.assert);
18
+ else if (validator.type === "is") return is(validator.is);
19
+ else if (validator.type === "validate") return validate(validator.validate);
20
+ return () =>
21
+ new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
22
+ };
23
+
24
+ /**
25
+ * @internal
26
+ */
27
+ const assert =
28
+ <T>(closure: (input: URLSearchParams) => T) =>
29
+ (input: URLSearchParams): T | BadRequestException => {
30
+ try {
31
+ return closure(input);
32
+ } catch (exp) {
33
+ if (typia.is<TypeGuardError>(exp)) {
34
+ return new BadRequestException({
35
+ path: exp.path,
36
+ reason: exp.message,
37
+ expected: exp.expected,
38
+ value: exp.value,
39
+ message: MESSAGE,
40
+ });
41
+ }
42
+ throw exp;
43
+ }
44
+ };
45
+
46
+ /**
47
+ * @internal
48
+ */
49
+ const is =
50
+ <T>(closure: (input: URLSearchParams) => T | null) =>
51
+ (input: URLSearchParams): T | BadRequestException => {
52
+ const result: T | null = closure(input);
53
+ return result !== null ? result : new BadRequestException(MESSAGE);
54
+ };
55
+
56
+ /**
57
+ * @internal
58
+ */
59
+ const validate =
60
+ <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
61
+ (input: URLSearchParams): T | BadRequestException => {
62
+ const result: IValidation<T> = closure(input);
63
+ return result.success
64
+ ? result.data
65
+ : new BadRequestException({
66
+ errors: result.errors,
67
+ message: MESSAGE,
68
+ });
69
+ };
70
+
71
+ /**
72
+ * @internal
73
+ */
74
+ const MESSAGE = "Request query data is not following the promised type.";
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as core from "./module";
2
-
3
- export * from "./module";
4
-
5
- export default core;
1
+ import * as core from "./module";
2
+
3
+ export * from "./module";
4
+
5
+ export default core;
package/src/module.ts CHANGED
@@ -1,21 +1,21 @@
1
- export * from "./decorators/DynamicModule";
2
- export * from "./utils/ExceptionManager";
3
-
4
- export * from "./decorators/TypedRoute";
5
- export * from "./decorators/TypedBody";
6
- export * from "./decorators/TypedQuery";
7
- export * from "./decorators/TypedException";
8
- export * from "./decorators/TypedHeaders";
9
- export * from "./decorators/TypedFormData";
10
- export * from "./decorators/TypedParam";
11
-
12
- export * from "./decorators/EncryptedController";
13
- export * from "./decorators/EncryptedRoute";
14
- export * from "./decorators/EncryptedBody";
15
- export * from "./decorators/EncryptedModule";
16
- export * from "./decorators/PlainBody";
17
- export * from "./decorators/SwaggerCustomizer";
18
- export * from "./decorators/SwaggerExample";
19
-
20
- export * from "./adaptors/WebSocketAdaptor";
21
- export * from "./decorators/WebSocketRoute";
1
+ export * from "./decorators/DynamicModule";
2
+ export * from "./utils/ExceptionManager";
3
+
4
+ export * from "./decorators/TypedRoute";
5
+ export * from "./decorators/TypedBody";
6
+ export * from "./decorators/TypedQuery";
7
+ export * from "./decorators/TypedException";
8
+ export * from "./decorators/TypedHeaders";
9
+ export * from "./decorators/TypedFormData";
10
+ export * from "./decorators/TypedParam";
11
+
12
+ export * from "./decorators/EncryptedController";
13
+ export * from "./decorators/EncryptedRoute";
14
+ export * from "./decorators/EncryptedBody";
15
+ export * from "./decorators/EncryptedModule";
16
+ export * from "./decorators/PlainBody";
17
+ export * from "./decorators/SwaggerCustomizer";
18
+ export * from "./decorators/SwaggerExample";
19
+
20
+ export * from "./adaptors/WebSocketAdaptor";
21
+ export * from "./decorators/WebSocketRoute";
@@ -1,24 +1,29 @@
1
- export interface INestiaTransformOptions {
2
- validate?: // NORMAL
3
- | "assert"
4
- | "is"
5
- | "validate"
6
- // STRICT
7
- | "assertEquals"
8
- | "equals"
9
- | "validateEquals"
10
- // CLONE
11
- | "assertClone"
12
- | "validateClone"
13
- // PRUNE
14
- | "assertPrune"
15
- | "validatePrune";
16
- stringify?:
17
- | "stringify"
18
- | "assert"
19
- | "is"
20
- | "validate"
21
- | "validate.log"
22
- | null;
23
- throws?: boolean;
24
- }
1
+ export interface INestiaTransformOptions {
2
+ validate?: INestiaTransformOptions.Validate;
3
+ stringify?: INestiaTransformOptions.Stringify | null;
4
+ throws?: boolean;
5
+ }
6
+ export namespace INestiaTransformOptions {
7
+ export type Validate =
8
+ // NORMAL
9
+ | "assert"
10
+ | "is"
11
+ | "validate"
12
+ // STRICT
13
+ | "assertEquals"
14
+ | "equals"
15
+ | "validateEquals"
16
+ // CLONE
17
+ | "assertClone"
18
+ | "validateClone"
19
+ // PRUNE
20
+ | "assertPrune"
21
+ | "validatePrune";
22
+
23
+ export type Stringify =
24
+ | "stringify"
25
+ | "assert"
26
+ | "is"
27
+ | "validate"
28
+ | "validate.log";
29
+ }
@@ -1,8 +1,8 @@
1
- import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
2
-
3
- import { INestiaTransformOptions } from "./INestiaTransformOptions";
4
-
5
- export interface INestiaTransformContext
6
- extends Omit<ITypiaContext, "options"> {
7
- options: INestiaTransformOptions;
8
- }
1
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
2
+
3
+ import { INestiaTransformOptions } from "./INestiaTransformOptions";
4
+
5
+ export interface INestiaTransformContext
6
+ extends Omit<ITypiaContext, "options"> {
7
+ options: INestiaTransformOptions;
8
+ }
@@ -1,20 +1,20 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IRequestBodyValidator<T> =
4
- | IRequestBodyValidator.IAssert<T>
5
- | IRequestBodyValidator.IIs<T>
6
- | IRequestBodyValidator.IValidate<T>;
7
- export namespace IRequestBodyValidator {
8
- export interface IAssert<T> {
9
- type: "assert";
10
- assert: (input: T) => T;
11
- }
12
- export interface IIs<T> {
13
- type: "is";
14
- is: (input: T) => boolean;
15
- }
16
- export interface IValidate<T> {
17
- type: "validate";
18
- validate: (input: T) => IValidation<T>;
19
- }
20
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IRequestBodyValidator<T> =
4
+ | IRequestBodyValidator.IAssert<T>
5
+ | IRequestBodyValidator.IIs<T>
6
+ | IRequestBodyValidator.IValidate<T>;
7
+ export namespace IRequestBodyValidator {
8
+ export interface IAssert<T> {
9
+ type: "assert";
10
+ assert: (input: T) => T;
11
+ }
12
+ export interface IIs<T> {
13
+ type: "is";
14
+ is: (input: T) => boolean;
15
+ }
16
+ export interface IValidate<T> {
17
+ type: "validate";
18
+ validate: (input: T) => IValidation<T>;
19
+ }
20
+ }
@@ -1,27 +1,27 @@
1
- import { IValidation } from "typia";
2
-
3
- export interface IRequestFormDataProps<T> {
4
- files: Array<IRequestFormDataProps.IFile>;
5
- validator:
6
- | IRequestFormDataProps.IAssert<T>
7
- | IRequestFormDataProps.IIs<T>
8
- | IRequestFormDataProps.IValidate<T>;
9
- }
10
- export namespace IRequestFormDataProps {
11
- export interface IAssert<T> {
12
- type: "assert";
13
- assert: (input: FormData) => T;
14
- }
15
- export interface IIs<T> {
16
- type: "is";
17
- is: (input: FormData) => T | null;
18
- }
19
- export interface IValidate<T> {
20
- type: "validate";
21
- validate: (input: FormData) => IValidation<T>;
22
- }
23
- export interface IFile {
24
- name: string;
25
- limit: number | null;
26
- }
27
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export interface IRequestFormDataProps<T> {
4
+ files: Array<IRequestFormDataProps.IFile>;
5
+ validator:
6
+ | IRequestFormDataProps.IAssert<T>
7
+ | IRequestFormDataProps.IIs<T>
8
+ | IRequestFormDataProps.IValidate<T>;
9
+ }
10
+ export namespace IRequestFormDataProps {
11
+ export interface IAssert<T> {
12
+ type: "assert";
13
+ assert: (input: FormData) => T;
14
+ }
15
+ export interface IIs<T> {
16
+ type: "is";
17
+ is: (input: FormData) => T | null;
18
+ }
19
+ export interface IValidate<T> {
20
+ type: "validate";
21
+ validate: (input: FormData) => IValidation<T>;
22
+ }
23
+ export interface IFile {
24
+ name: string;
25
+ limit: number | null;
26
+ }
27
+ }
@@ -1,22 +1,22 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IRequestHeadersValidator<T> =
4
- | IRequestHeadersValidator.IAssert<T>
5
- | IRequestHeadersValidator.IIs<T>
6
- | IRequestHeadersValidator.IValidate<T>;
7
- export namespace IRequestHeadersValidator {
8
- export interface IAssert<T> {
9
- type: "assert";
10
- assert: (input: Record<string, string | string[] | undefined>) => T;
11
- }
12
- export interface IIs<T> {
13
- type: "is";
14
- is: (input: Record<string, string | string[] | undefined>) => T | null;
15
- }
16
- export interface IValidate<T> {
17
- type: "validate";
18
- validate: (
19
- input: Record<string, string | string[] | undefined>,
20
- ) => IValidation<T>;
21
- }
22
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IRequestHeadersValidator<T> =
4
+ | IRequestHeadersValidator.IAssert<T>
5
+ | IRequestHeadersValidator.IIs<T>
6
+ | IRequestHeadersValidator.IValidate<T>;
7
+ export namespace IRequestHeadersValidator {
8
+ export interface IAssert<T> {
9
+ type: "assert";
10
+ assert: (input: Record<string, string | string[] | undefined>) => T;
11
+ }
12
+ export interface IIs<T> {
13
+ type: "is";
14
+ is: (input: Record<string, string | string[] | undefined>) => T | null;
15
+ }
16
+ export interface IValidate<T> {
17
+ type: "validate";
18
+ validate: (
19
+ input: Record<string, string | string[] | undefined>,
20
+ ) => IValidation<T>;
21
+ }
22
+ }
@@ -1,20 +1,20 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IRequestQueryValidator<T> =
4
- | IRequestQueryValidator.IAssert<T>
5
- | IRequestQueryValidator.IIs<T>
6
- | IRequestQueryValidator.IValidate<T>;
7
- export namespace IRequestQueryValidator {
8
- export interface IAssert<T> {
9
- type: "assert";
10
- assert: (input: URLSearchParams) => T;
11
- }
12
- export interface IIs<T> {
13
- type: "is";
14
- is: (input: URLSearchParams) => T | null;
15
- }
16
- export interface IValidate<T> {
17
- type: "validate";
18
- validate: (input: URLSearchParams) => IValidation<T>;
19
- }
20
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IRequestQueryValidator<T> =
4
+ | IRequestQueryValidator.IAssert<T>
5
+ | IRequestQueryValidator.IIs<T>
6
+ | IRequestQueryValidator.IValidate<T>;
7
+ export namespace IRequestQueryValidator {
8
+ export interface IAssert<T> {
9
+ type: "assert";
10
+ assert: (input: URLSearchParams) => T;
11
+ }
12
+ export interface IIs<T> {
13
+ type: "is";
14
+ is: (input: URLSearchParams) => T | null;
15
+ }
16
+ export interface IValidate<T> {
17
+ type: "validate";
18
+ validate: (input: URLSearchParams) => IValidation<T>;
19
+ }
20
+ }
@@ -1,25 +1,25 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IResponseBodyQuerifier<T> =
4
- | IResponseBodyquerifier.IStringify<T>
5
- | IResponseBodyquerifier.IIs<T>
6
- | IResponseBodyquerifier.IAssert<T>
7
- | IResponseBodyquerifier.IValidate<T>;
8
- export namespace IResponseBodyquerifier {
9
- export interface IStringify<T> {
10
- type: "stringify";
11
- stringify: (input: T) => URLSearchParams;
12
- }
13
- export interface IIs<T> {
14
- type: "is";
15
- is: (input: T) => URLSearchParams | null;
16
- }
17
- export interface IAssert<T> {
18
- type: "assert";
19
- assert: (input: T) => URLSearchParams;
20
- }
21
- export interface IValidate<T> {
22
- type: "validate";
23
- validate: (input: T) => IValidation<URLSearchParams>;
24
- }
25
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IResponseBodyQuerifier<T> =
4
+ | IResponseBodyquerifier.IStringify<T>
5
+ | IResponseBodyquerifier.IIs<T>
6
+ | IResponseBodyquerifier.IAssert<T>
7
+ | IResponseBodyquerifier.IValidate<T>;
8
+ export namespace IResponseBodyquerifier {
9
+ export interface IStringify<T> {
10
+ type: "stringify";
11
+ stringify: (input: T) => URLSearchParams;
12
+ }
13
+ export interface IIs<T> {
14
+ type: "is";
15
+ is: (input: T) => URLSearchParams | null;
16
+ }
17
+ export interface IAssert<T> {
18
+ type: "assert";
19
+ assert: (input: T) => URLSearchParams;
20
+ }
21
+ export interface IValidate<T> {
22
+ type: "validate";
23
+ validate: (input: T) => IValidation<URLSearchParams>;
24
+ }
25
+ }
@@ -1,30 +1,30 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IResponseBodyStringifier<T> =
4
- | IResponseBodyStringifier.IStringify<T>
5
- | IResponseBodyStringifier.IIs<T>
6
- | IResponseBodyStringifier.IAssert<T>
7
- | IResponseBodyStringifier.IValidate<T>
8
- | IResponseBodyStringifier.IValidateLog<T>;
9
- export namespace IResponseBodyStringifier {
10
- export interface IStringify<T> {
11
- type: "stringify";
12
- stringify: (input: T) => string;
13
- }
14
- export interface IIs<T> {
15
- type: "is";
16
- is: (input: T) => string | null;
17
- }
18
- export interface IAssert<T> {
19
- type: "assert";
20
- assert: (input: T) => string;
21
- }
22
- export interface IValidate<T> {
23
- type: "validate";
24
- validate: (input: T) => IValidation<string>;
25
- }
26
- export interface IValidateLog<T> {
27
- type: "validate.log";
28
- validate: (input: T) => IValidation<string>;
29
- }
30
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IResponseBodyStringifier<T> =
4
+ | IResponseBodyStringifier.IStringify<T>
5
+ | IResponseBodyStringifier.IIs<T>
6
+ | IResponseBodyStringifier.IAssert<T>
7
+ | IResponseBodyStringifier.IValidate<T>
8
+ | IResponseBodyStringifier.IValidateLog<T>;
9
+ export namespace IResponseBodyStringifier {
10
+ export interface IStringify<T> {
11
+ type: "stringify";
12
+ stringify: (input: T) => string;
13
+ }
14
+ export interface IIs<T> {
15
+ type: "is";
16
+ is: (input: T) => string | null;
17
+ }
18
+ export interface IAssert<T> {
19
+ type: "assert";
20
+ assert: (input: T) => string;
21
+ }
22
+ export interface IValidate<T> {
23
+ type: "validate";
24
+ validate: (input: T) => IValidation<string>;
25
+ }
26
+ export interface IValidateLog<T> {
27
+ type: "validate.log";
28
+ validate: (input: T) => IValidation<string>;
29
+ }
30
+ }