@nestia/core 3.1.0-dev.20240426 → 3.1.0-dev.20240430

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 (67) hide show
  1. package/lib/adaptors/WebSocketAdaptor.js +15 -17
  2. package/lib/adaptors/WebSocketAdaptor.js.map +1 -1
  3. package/lib/transformers/MethodTransformer.js +7 -4
  4. package/lib/transformers/MethodTransformer.js.map +1 -1
  5. package/lib/transformers/TypedExceptionTransformer.js +2 -3
  6. package/lib/transformers/TypedExceptionTransformer.js.map +1 -1
  7. package/lib/transformers/TypedRouteTransformer.js +1 -3
  8. package/lib/transformers/TypedRouteTransformer.js.map +1 -1
  9. package/lib/transformers/WebSocketRouteTransformer.d.ts +6 -0
  10. package/lib/transformers/WebSocketRouteTransformer.js +72 -0
  11. package/lib/transformers/WebSocketRouteTransformer.js.map +1 -0
  12. package/package.json +4 -4
  13. package/src/adaptors/WebSocketAdaptor.ts +19 -17
  14. package/src/decorators/DynamicModule.ts +39 -39
  15. package/src/decorators/EncryptedBody.ts +105 -105
  16. package/src/decorators/EncryptedController.ts +38 -38
  17. package/src/decorators/EncryptedModule.ts +96 -96
  18. package/src/decorators/EncryptedRoute.ts +182 -182
  19. package/src/decorators/PlainBody.ts +75 -75
  20. package/src/decorators/TypedBody.ts +62 -62
  21. package/src/decorators/TypedException.ts +90 -90
  22. package/src/decorators/TypedFormData.ts +219 -219
  23. package/src/decorators/TypedHeaders.ts +69 -69
  24. package/src/decorators/TypedParam.ts +64 -64
  25. package/src/decorators/TypedRoute.ts +144 -144
  26. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  27. package/src/decorators/internal/NoTransformConfigureError.ts +8 -8
  28. package/src/decorators/internal/get_path_and_querify.ts +106 -106
  29. package/src/decorators/internal/get_path_and_stringify.ts +91 -91
  30. package/src/decorators/internal/get_text_body.ts +20 -20
  31. package/src/decorators/internal/headers_to_object.ts +13 -13
  32. package/src/decorators/internal/load_controller.ts +51 -51
  33. package/src/decorators/internal/route_error.ts +45 -45
  34. package/src/index.ts +5 -5
  35. package/src/options/INestiaTransformOptions.ts +17 -17
  36. package/src/options/INestiaTransformProject.ts +7 -7
  37. package/src/options/IRequestBodyValidator.ts +20 -20
  38. package/src/options/IRequestFormDataProps.ts +27 -27
  39. package/src/options/IRequestHeadersValidator.ts +22 -22
  40. package/src/options/IRequestQueryValidator.ts +20 -20
  41. package/src/options/IResponseBodyQuerifier.ts +25 -25
  42. package/src/options/IResponseBodyStringifier.ts +25 -25
  43. package/src/programmers/PlainBodyProgrammer.ts +52 -52
  44. package/src/programmers/TypedBodyProgrammer.ts +108 -108
  45. package/src/programmers/TypedExceptionProgrammer.ts +71 -71
  46. package/src/programmers/TypedHeadersProgrammer.ts +56 -56
  47. package/src/programmers/TypedParamProgrammer.ts +24 -24
  48. package/src/programmers/TypedQueryBodyProgrammer.ts +56 -56
  49. package/src/programmers/TypedQueryProgrammer.ts +56 -56
  50. package/src/programmers/TypedQueryRouteProgrammer.ts +51 -51
  51. package/src/programmers/TypedRouteProgrammer.ts +51 -51
  52. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +58 -58
  53. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +62 -62
  54. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +63 -63
  55. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  56. package/src/transform.ts +35 -35
  57. package/src/transformers/FileTransformer.ts +66 -66
  58. package/src/transformers/MethodTransformer.ts +97 -94
  59. package/src/transformers/NodeTransformer.ts +16 -16
  60. package/src/transformers/ParameterTransformer.ts +48 -48
  61. package/src/transformers/TypedExceptionTransformer.ts +44 -48
  62. package/src/transformers/TypedRouteTransformer.ts +81 -88
  63. package/src/transformers/WebSocketRouteTransformer.ts +103 -0
  64. package/src/typings/Creator.ts +3 -3
  65. package/src/utils/ExceptionManager.ts +112 -112
  66. package/src/utils/Singleton.ts +20 -20
  67. package/src/utils/SourceFinder.ts +57 -57
@@ -1,66 +1,66 @@
1
- import ts from "typescript";
2
- import { TransformerError } from "typia/lib/transformers/TransformerError";
3
-
4
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
5
- import { NodeTransformer } from "./NodeTransformer";
6
-
7
- export namespace FileTransformer {
8
- export const transform =
9
- (project: Omit<INestiaTransformProject, "context">) =>
10
- (context: ts.TransformationContext) =>
11
- (file: ts.SourceFile): ts.SourceFile =>
12
- file.isDeclarationFile
13
- ? file
14
- : ts.visitEachChild(
15
- file,
16
- (node) =>
17
- iterate_node({
18
- ...project,
19
- context,
20
- })(context)(file)(node),
21
- context,
22
- );
23
-
24
- const iterate_node =
25
- (project: INestiaTransformProject) =>
26
- (context: ts.TransformationContext) =>
27
- (file: ts.SourceFile) =>
28
- (node: ts.Node): ts.Node =>
29
- ts.visitEachChild(
30
- try_transform_node(project)(file)(node) ?? node,
31
- (child) => iterate_node(project)(context)(file)(child),
32
- context,
33
- );
34
-
35
- const try_transform_node =
36
- (project: INestiaTransformProject) =>
37
- (file: ts.SourceFile) =>
38
- (node: ts.Node): ts.Node | null => {
39
- try {
40
- return NodeTransformer.transform(project)(node);
41
- } catch (exp) {
42
- // ONLY ACCEPT TRANSFORMER-ERROR
43
- if (!isTransformerError(exp)) throw exp;
44
-
45
- // AVOID SPECIAL BUG OF TYPESCRIPT COMPILER API
46
- (node as any).parent ??= file;
47
-
48
- // REPORT DIAGNOSTIC
49
- const diagnostic = ts.createDiagnosticForNode(node, {
50
- key: exp.code,
51
- category: ts.DiagnosticCategory.Error,
52
- message: exp.message,
53
- code: `(${exp.code})` as any,
54
- });
55
- project.extras.addDiagnostic(diagnostic);
56
- return null;
57
- }
58
- };
59
- }
60
-
61
- const isTransformerError = (error: any): error is TransformerError =>
62
- typeof error === "object" &&
63
- error !== null &&
64
- error.constructor.name === "TransformerError" &&
65
- typeof error.code === "string" &&
66
- typeof error.message === "string";
1
+ import ts from "typescript";
2
+ import { TransformerError } from "typia/lib/transformers/TransformerError";
3
+
4
+ import { INestiaTransformProject } from "../options/INestiaTransformProject";
5
+ import { NodeTransformer } from "./NodeTransformer";
6
+
7
+ export namespace FileTransformer {
8
+ export const transform =
9
+ (project: Omit<INestiaTransformProject, "context">) =>
10
+ (context: ts.TransformationContext) =>
11
+ (file: ts.SourceFile): ts.SourceFile =>
12
+ file.isDeclarationFile
13
+ ? file
14
+ : ts.visitEachChild(
15
+ file,
16
+ (node) =>
17
+ iterate_node({
18
+ ...project,
19
+ context,
20
+ })(context)(file)(node),
21
+ context,
22
+ );
23
+
24
+ const iterate_node =
25
+ (project: INestiaTransformProject) =>
26
+ (context: ts.TransformationContext) =>
27
+ (file: ts.SourceFile) =>
28
+ (node: ts.Node): ts.Node =>
29
+ ts.visitEachChild(
30
+ try_transform_node(project)(file)(node) ?? node,
31
+ (child) => iterate_node(project)(context)(file)(child),
32
+ context,
33
+ );
34
+
35
+ const try_transform_node =
36
+ (project: INestiaTransformProject) =>
37
+ (file: ts.SourceFile) =>
38
+ (node: ts.Node): ts.Node | null => {
39
+ try {
40
+ return NodeTransformer.transform(project)(node);
41
+ } catch (exp) {
42
+ // ONLY ACCEPT TRANSFORMER-ERROR
43
+ if (!isTransformerError(exp)) throw exp;
44
+
45
+ // AVOID SPECIAL BUG OF TYPESCRIPT COMPILER API
46
+ (node as any).parent ??= file;
47
+
48
+ // REPORT DIAGNOSTIC
49
+ const diagnostic = ts.createDiagnosticForNode(node, {
50
+ key: exp.code,
51
+ category: ts.DiagnosticCategory.Error,
52
+ message: exp.message,
53
+ code: `(${exp.code})` as any,
54
+ });
55
+ project.extras.addDiagnostic(diagnostic);
56
+ return null;
57
+ }
58
+ };
59
+ }
60
+
61
+ const isTransformerError = (error: any): error is TransformerError =>
62
+ typeof error === "object" &&
63
+ error !== null &&
64
+ error.constructor.name === "TransformerError" &&
65
+ typeof error.code === "string" &&
66
+ typeof error.message === "string";
@@ -1,94 +1,97 @@
1
- import ts from "typescript";
2
-
3
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
4
- import { TypedExceptionTransformer } from "./TypedExceptionTransformer";
5
- import { TypedRouteTransformer } from "./TypedRouteTransformer";
6
-
7
- export namespace MethodTransformer {
8
- export const transform =
9
- (project: INestiaTransformProject) =>
10
- (method: ts.MethodDeclaration): ts.MethodDeclaration => {
11
- const decorators: readonly ts.Decorator[] | undefined = ts.getDecorators
12
- ? ts.getDecorators(method)
13
- : (method as any).decorators;
14
- if (!decorators?.length) return method;
15
-
16
- const signature: ts.Signature | undefined =
17
- project.checker.getSignatureFromDeclaration(method);
18
- const original: ts.Type | undefined =
19
- signature && project.checker.getReturnTypeOfSignature(signature);
20
- const escaped: ts.Type | undefined =
21
- original && get_escaped_type(project.checker)(original);
22
-
23
- if (escaped === undefined) return method;
24
-
25
- const operator = (deco: ts.Decorator): ts.Decorator => {
26
- deco = TypedExceptionTransformer.transform(project)(deco);
27
- deco = TypedRouteTransformer.transform(project)(escaped)(deco);
28
- return deco;
29
- };
30
- if (ts.getDecorators !== undefined)
31
- return ts.factory.updateMethodDeclaration(
32
- method,
33
- (method.modifiers || []).map((mod) =>
34
- ts.isDecorator(mod) ? operator(mod) : mod,
35
- ),
36
- method.asteriskToken,
37
- method.name,
38
- method.questionToken,
39
- method.typeParameters,
40
- method.parameters,
41
- method.type,
42
- method.body,
43
- );
44
- // eslint-disable-next-line
45
- return (ts.factory.updateMethodDeclaration as any)(
46
- method,
47
- decorators.map(operator),
48
- (method as any).modifiers,
49
- method.asteriskToken,
50
- method.name,
51
- method.questionToken,
52
- method.typeParameters,
53
- method.parameters,
54
- method.type,
55
- method.body,
56
- );
57
- };
58
- }
59
-
60
- const get_escaped_type =
61
- (checker: ts.TypeChecker) =>
62
- (type: ts.Type): ts.Type => {
63
- const symbol: ts.Symbol | undefined = type.getSymbol() || type.aliasSymbol;
64
- return symbol && get_name(symbol) === "Promise"
65
- ? escape_promise(checker)(type)
66
- : type;
67
- };
68
-
69
- const escape_promise =
70
- (checker: ts.TypeChecker) =>
71
- (type: ts.Type): ts.Type => {
72
- const generic: readonly ts.Type[] = checker.getTypeArguments(
73
- type as ts.TypeReference,
74
- );
75
- if (generic.length !== 1)
76
- throw new Error(
77
- "Error on ImportAnalyzer.analyze(): invalid promise type.",
78
- );
79
- return generic[0];
80
- };
81
-
82
- const get_name = (symbol: ts.Symbol): string =>
83
- explore_name(symbol.getDeclarations()![0].parent)(
84
- symbol.escapedName.toString(),
85
- );
86
-
87
- const explore_name =
88
- (decl: ts.Node) =>
89
- (name: string): string =>
90
- ts.isModuleBlock(decl)
91
- ? explore_name(decl.parent.parent)(
92
- `${decl.parent.name.getFullText().trim()}.${name}`,
93
- )
94
- : name;
1
+ import ts from "typescript";
2
+
3
+ import { INestiaTransformProject } from "../options/INestiaTransformProject";
4
+ import { TypedExceptionTransformer } from "./TypedExceptionTransformer";
5
+ import { TypedRouteTransformer } from "./TypedRouteTransformer";
6
+ import { WebSocketRouteTransformer } from "./WebSocketRouteTransformer";
7
+
8
+ export namespace MethodTransformer {
9
+ export const transform =
10
+ (project: INestiaTransformProject) =>
11
+ (method: ts.MethodDeclaration): ts.MethodDeclaration => {
12
+ const decorators: readonly ts.Decorator[] | undefined = ts.getDecorators
13
+ ? ts.getDecorators(method)
14
+ : (method as any).decorators;
15
+ if (!decorators?.length) return method;
16
+
17
+ const signature: ts.Signature | undefined =
18
+ project.checker.getSignatureFromDeclaration(method);
19
+ const original: ts.Type | undefined =
20
+ signature && project.checker.getReturnTypeOfSignature(signature);
21
+ const escaped: ts.Type | undefined =
22
+ original && get_escaped_type(project.checker)(original);
23
+
24
+ if (escaped === undefined) return method;
25
+
26
+ const operator = (decorator: ts.Decorator): ts.Decorator => {
27
+ decorator = TypedExceptionTransformer.transform(project)(decorator);
28
+ decorator =
29
+ TypedRouteTransformer.transform(project)(escaped)(decorator);
30
+ WebSocketRouteTransformer.validate(project)(decorator, method);
31
+ return decorator;
32
+ };
33
+ if (ts.getDecorators !== undefined)
34
+ return ts.factory.updateMethodDeclaration(
35
+ method,
36
+ (method.modifiers || []).map((mod) =>
37
+ ts.isDecorator(mod) ? operator(mod) : mod,
38
+ ),
39
+ method.asteriskToken,
40
+ method.name,
41
+ method.questionToken,
42
+ method.typeParameters,
43
+ method.parameters,
44
+ method.type,
45
+ method.body,
46
+ );
47
+ // eslint-disable-next-line
48
+ return (ts.factory.updateMethodDeclaration as any)(
49
+ method,
50
+ decorators.map(operator),
51
+ (method as any).modifiers,
52
+ method.asteriskToken,
53
+ method.name,
54
+ method.questionToken,
55
+ method.typeParameters,
56
+ method.parameters,
57
+ method.type,
58
+ method.body,
59
+ );
60
+ };
61
+ }
62
+
63
+ const get_escaped_type =
64
+ (checker: ts.TypeChecker) =>
65
+ (type: ts.Type): ts.Type => {
66
+ const symbol: ts.Symbol | undefined = type.getSymbol() || type.aliasSymbol;
67
+ return symbol && get_name(symbol) === "Promise"
68
+ ? escape_promise(checker)(type)
69
+ : type;
70
+ };
71
+
72
+ const escape_promise =
73
+ (checker: ts.TypeChecker) =>
74
+ (type: ts.Type): ts.Type => {
75
+ const generic: readonly ts.Type[] = checker.getTypeArguments(
76
+ type as ts.TypeReference,
77
+ );
78
+ if (generic.length !== 1)
79
+ throw new Error(
80
+ "Error on ImportAnalyzer.analyze(): invalid promise type.",
81
+ );
82
+ return generic[0];
83
+ };
84
+
85
+ const get_name = (symbol: ts.Symbol): string =>
86
+ explore_name(symbol.getDeclarations()![0].parent)(
87
+ symbol.escapedName.toString(),
88
+ );
89
+
90
+ const explore_name =
91
+ (decl: ts.Node) =>
92
+ (name: string): string =>
93
+ ts.isModuleBlock(decl)
94
+ ? explore_name(decl.parent.parent)(
95
+ `${decl.parent.name.getFullText().trim()}.${name}`,
96
+ )
97
+ : name;
@@ -1,16 +1,16 @@
1
- import ts from "typescript";
2
-
3
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
4
- import { MethodTransformer } from "./MethodTransformer";
5
- import { ParameterTransformer } from "./ParameterTransformer";
6
-
7
- export namespace NodeTransformer {
8
- export const transform =
9
- (project: INestiaTransformProject) =>
10
- (node: ts.Node): ts.Node =>
11
- ts.isMethodDeclaration(node)
12
- ? MethodTransformer.transform(project)(node)
13
- : ts.isParameter(node)
14
- ? ParameterTransformer.transform(project)(node)
15
- : node;
16
- }
1
+ import ts from "typescript";
2
+
3
+ import { INestiaTransformProject } from "../options/INestiaTransformProject";
4
+ import { MethodTransformer } from "./MethodTransformer";
5
+ import { ParameterTransformer } from "./ParameterTransformer";
6
+
7
+ export namespace NodeTransformer {
8
+ export const transform =
9
+ (project: INestiaTransformProject) =>
10
+ (node: ts.Node): ts.Node =>
11
+ ts.isMethodDeclaration(node)
12
+ ? MethodTransformer.transform(project)(node)
13
+ : ts.isParameter(node)
14
+ ? ParameterTransformer.transform(project)(node)
15
+ : node;
16
+ }
@@ -1,48 +1,48 @@
1
- import ts from "typescript";
2
-
3
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
4
- import { ParameterDecoratorTransformer } from "./ParameterDecoratorTransformer";
5
-
6
- export namespace ParameterTransformer {
7
- export const transform =
8
- (project: INestiaTransformProject) =>
9
- (param: ts.ParameterDeclaration): ts.ParameterDeclaration => {
10
- // CHECK DECORATOR
11
- const decorators: readonly ts.Decorator[] | undefined = ts.getDecorators
12
- ? ts.getDecorators(param)
13
- : (param as any).decorators;
14
- if (!decorators?.length) return param;
15
-
16
- // GET TYPE INFO
17
- const type: ts.Type = project.checker.getTypeAtLocation(param);
18
-
19
- // WHEN LATEST TS VERSION
20
- if (ts.getDecorators !== undefined)
21
- return ts.factory.updateParameterDeclaration(
22
- param,
23
- (param.modifiers || []).map((mod) =>
24
- ts.isDecorator(mod)
25
- ? ParameterDecoratorTransformer.transform(project)(type)(mod)
26
- : mod,
27
- ),
28
- param.dotDotDotToken,
29
- param.name,
30
- param.questionToken,
31
- param.type,
32
- param.initializer,
33
- );
34
- // eslint-disable-next-line
35
- return (ts.factory.updateParameterDeclaration as any)(
36
- param,
37
- decorators.map((deco) =>
38
- ParameterDecoratorTransformer.transform(project)(type)(deco),
39
- ),
40
- (param as any).modifiers,
41
- param.dotDotDotToken,
42
- param.name,
43
- param.questionToken,
44
- param.type,
45
- param.initializer,
46
- );
47
- };
48
- }
1
+ import ts from "typescript";
2
+
3
+ import { INestiaTransformProject } from "../options/INestiaTransformProject";
4
+ import { ParameterDecoratorTransformer } from "./ParameterDecoratorTransformer";
5
+
6
+ export namespace ParameterTransformer {
7
+ export const transform =
8
+ (project: INestiaTransformProject) =>
9
+ (param: ts.ParameterDeclaration): ts.ParameterDeclaration => {
10
+ // CHECK DECORATOR
11
+ const decorators: readonly ts.Decorator[] | undefined = ts.getDecorators
12
+ ? ts.getDecorators(param)
13
+ : (param as any).decorators;
14
+ if (!decorators?.length) return param;
15
+
16
+ // GET TYPE INFO
17
+ const type: ts.Type = project.checker.getTypeAtLocation(param);
18
+
19
+ // WHEN LATEST TS VERSION
20
+ if (ts.getDecorators !== undefined)
21
+ return ts.factory.updateParameterDeclaration(
22
+ param,
23
+ (param.modifiers || []).map((mod) =>
24
+ ts.isDecorator(mod)
25
+ ? ParameterDecoratorTransformer.transform(project)(type)(mod)
26
+ : mod,
27
+ ),
28
+ param.dotDotDotToken,
29
+ param.name,
30
+ param.questionToken,
31
+ param.type,
32
+ param.initializer,
33
+ );
34
+ // eslint-disable-next-line
35
+ return (ts.factory.updateParameterDeclaration as any)(
36
+ param,
37
+ decorators.map((deco) =>
38
+ ParameterDecoratorTransformer.transform(project)(type)(deco),
39
+ ),
40
+ (param as any).modifiers,
41
+ param.dotDotDotToken,
42
+ param.name,
43
+ param.questionToken,
44
+ param.type,
45
+ param.initializer,
46
+ );
47
+ };
48
+ }
@@ -1,48 +1,44 @@
1
- import path from "path";
2
- import ts from "typescript";
3
-
4
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
5
- import { TypedExceptionProgrammer } from "../programmers/TypedExceptionProgrammer";
6
-
7
- export namespace TypedExceptionTransformer {
8
- export const transform =
9
- (project: INestiaTransformProject) =>
10
- (decorator: ts.Decorator): ts.Decorator => {
11
- if (!ts.isCallExpression(decorator.expression)) return decorator;
12
-
13
- // CHECK SIGNATURE
14
- const signature: ts.Signature | undefined =
15
- project.checker.getResolvedSignature(decorator.expression);
16
- if (!signature || !signature.declaration) return decorator;
17
-
18
- // CHECK TO BE TRANSFORMED
19
- const done: boolean = (() => {
20
- // CHECK FILENAME
21
- const location: string = path.resolve(
22
- signature.declaration.getSourceFile().fileName,
23
- );
24
- if (location.indexOf(LIB_PATH) === -1 && location !== SRC_PATH)
25
- return false;
26
-
27
- // CHECK DUPLICATED
28
- return decorator.expression.arguments.length !== 3;
29
- })();
30
- if (done === false) return decorator;
31
-
32
- // DO TRANSFORM
33
- return ts.factory.createDecorator(
34
- TypedExceptionProgrammer.generate(project)(decorator.expression),
35
- );
36
- };
37
-
38
- const LIB_PATH = path.join(
39
- "@nestia",
40
- "core",
41
- "lib",
42
- "decorators",
43
- `TypedException.d.ts`,
44
- );
45
- const SRC_PATH = path.resolve(
46
- path.join(__dirname, "..", "decorators", `TypedException.ts`),
47
- );
48
- }
1
+ import path from "path";
2
+ import ts from "typescript";
3
+
4
+ import { INestiaTransformProject } from "../options/INestiaTransformProject";
5
+ import { TypedExceptionProgrammer } from "../programmers/TypedExceptionProgrammer";
6
+
7
+ export namespace TypedExceptionTransformer {
8
+ export const transform =
9
+ (project: INestiaTransformProject) =>
10
+ (decorator: ts.Decorator): ts.Decorator => {
11
+ if (!ts.isCallExpression(decorator.expression)) return decorator;
12
+
13
+ // CHECK SIGNATURE
14
+ const signature: ts.Signature | undefined =
15
+ project.checker.getResolvedSignature(decorator.expression);
16
+ if (!signature || !signature.declaration) return decorator;
17
+
18
+ // CHECK TO BE TRANSFORMED
19
+ const done: boolean = (() => {
20
+ // CHECK FILENAME
21
+ const location: string = path.resolve(
22
+ signature.declaration.getSourceFile().fileName,
23
+ );
24
+ if (location.indexOf(LIB_PATH) === -1) return false;
25
+
26
+ // CHECK DUPLICATED
27
+ return decorator.expression.arguments.length !== 3;
28
+ })();
29
+ if (done === false) return decorator;
30
+
31
+ // DO TRANSFORM
32
+ return ts.factory.createDecorator(
33
+ TypedExceptionProgrammer.generate(project)(decorator.expression),
34
+ );
35
+ };
36
+ }
37
+
38
+ const LIB_PATH = path.join(
39
+ "@nestia",
40
+ "core",
41
+ "lib",
42
+ "decorators",
43
+ `TypedException.d.ts`,
44
+ );