@nestia/core 3.1.0-dev.20240429 → 3.1.0-dev.20240430-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 (57) hide show
  1. package/lib/transformers/WebSocketRouteTransformer.js +3 -4
  2. package/lib/transformers/WebSocketRouteTransformer.js.map +1 -1
  3. package/package.json +3 -3
  4. package/src/decorators/DynamicModule.ts +39 -39
  5. package/src/decorators/EncryptedBody.ts +105 -105
  6. package/src/decorators/EncryptedController.ts +38 -38
  7. package/src/decorators/EncryptedModule.ts +96 -96
  8. package/src/decorators/EncryptedRoute.ts +182 -182
  9. package/src/decorators/PlainBody.ts +75 -75
  10. package/src/decorators/TypedBody.ts +62 -62
  11. package/src/decorators/TypedException.ts +90 -90
  12. package/src/decorators/TypedFormData.ts +219 -219
  13. package/src/decorators/TypedHeaders.ts +69 -69
  14. package/src/decorators/TypedParam.ts +64 -64
  15. package/src/decorators/TypedRoute.ts +144 -144
  16. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  17. package/src/decorators/internal/NoTransformConfigureError.ts +8 -8
  18. package/src/decorators/internal/get_path_and_querify.ts +106 -106
  19. package/src/decorators/internal/get_path_and_stringify.ts +91 -91
  20. package/src/decorators/internal/get_text_body.ts +20 -20
  21. package/src/decorators/internal/headers_to_object.ts +13 -13
  22. package/src/decorators/internal/load_controller.ts +51 -51
  23. package/src/decorators/internal/route_error.ts +45 -45
  24. package/src/index.ts +5 -5
  25. package/src/options/INestiaTransformOptions.ts +17 -17
  26. package/src/options/INestiaTransformProject.ts +7 -7
  27. package/src/options/IRequestBodyValidator.ts +20 -20
  28. package/src/options/IRequestFormDataProps.ts +27 -27
  29. package/src/options/IRequestHeadersValidator.ts +22 -22
  30. package/src/options/IRequestQueryValidator.ts +20 -20
  31. package/src/options/IResponseBodyQuerifier.ts +25 -25
  32. package/src/options/IResponseBodyStringifier.ts +25 -25
  33. package/src/programmers/PlainBodyProgrammer.ts +52 -52
  34. package/src/programmers/TypedBodyProgrammer.ts +108 -108
  35. package/src/programmers/TypedExceptionProgrammer.ts +71 -71
  36. package/src/programmers/TypedHeadersProgrammer.ts +56 -56
  37. package/src/programmers/TypedParamProgrammer.ts +24 -24
  38. package/src/programmers/TypedQueryBodyProgrammer.ts +56 -56
  39. package/src/programmers/TypedQueryProgrammer.ts +56 -56
  40. package/src/programmers/TypedQueryRouteProgrammer.ts +51 -51
  41. package/src/programmers/TypedRouteProgrammer.ts +51 -51
  42. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +58 -58
  43. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +62 -62
  44. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +63 -63
  45. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  46. package/src/transform.ts +35 -35
  47. package/src/transformers/FileTransformer.ts +66 -66
  48. package/src/transformers/MethodTransformer.ts +97 -97
  49. package/src/transformers/NodeTransformer.ts +16 -16
  50. package/src/transformers/ParameterTransformer.ts +48 -48
  51. package/src/transformers/TypedExceptionTransformer.ts +44 -44
  52. package/src/transformers/TypedRouteTransformer.ts +81 -81
  53. package/src/transformers/WebSocketRouteTransformer.ts +8 -3
  54. package/src/typings/Creator.ts +3 -3
  55. package/src/utils/ExceptionManager.ts +112 -112
  56. package/src/utils/Singleton.ts +20 -20
  57. package/src/utils/SourceFinder.ts +57 -57
@@ -1,51 +1,51 @@
1
- import ts from "typescript";
2
- import { JsonAssertStringifyProgrammer } from "typia/lib/programmers/json/JsonAssertStringifyProgrammer";
3
- import { JsonIsStringifyProgrammer } from "typia/lib/programmers/json/JsonIsStringifyProgrammer";
4
- import { JsonStringifyProgrammer } from "typia/lib/programmers/json/JsonStringifyProgrammer";
5
- import { JsonValidateStringifyProgrammer } from "typia/lib/programmers/json/JsonValidateStringifyProgrammer";
6
- import { IProject } from "typia/lib/transformers/IProject";
7
-
8
- import { INestiaTransformProject } from "../options/INestiaTransformProject";
9
-
10
- export namespace TypedRouteProgrammer {
11
- export const generate =
12
- (project: INestiaTransformProject) =>
13
- (modulo: ts.LeftHandSideExpression) =>
14
- (type: ts.Type): ts.Expression => {
15
- // GENERATE STRINGIFY PLAN
16
- const parameter = (
17
- key: string,
18
- programmer: (
19
- project: IProject,
20
- ) => (
21
- modulo: ts.LeftHandSideExpression,
22
- ) => (type: ts.Type) => ts.ArrowFunction,
23
- ) =>
24
- ts.factory.createObjectLiteralExpression([
25
- ts.factory.createPropertyAssignment(
26
- ts.factory.createIdentifier("type"),
27
- ts.factory.createStringLiteral(key),
28
- ),
29
- ts.factory.createPropertyAssignment(
30
- ts.factory.createIdentifier(key),
31
- programmer({
32
- ...project,
33
- options: {}, // use default option
34
- })(modulo)(type),
35
- ),
36
- ]);
37
-
38
- // RETURNS
39
- if (project.options.stringify === "is")
40
- return parameter("is", JsonIsStringifyProgrammer.write);
41
- else if (project.options.stringify === "validate")
42
- return parameter("validate", JsonValidateStringifyProgrammer.write);
43
- else if (project.options.stringify === "stringify")
44
- return parameter("stringify", JsonStringifyProgrammer.write);
45
- else if (project.options.stringify === null)
46
- return ts.factory.createNull();
47
-
48
- // ASSERT IS DEFAULT
49
- return parameter("assert", JsonAssertStringifyProgrammer.write);
50
- };
51
- }
1
+ import ts from "typescript";
2
+ import { JsonAssertStringifyProgrammer } from "typia/lib/programmers/json/JsonAssertStringifyProgrammer";
3
+ import { JsonIsStringifyProgrammer } from "typia/lib/programmers/json/JsonIsStringifyProgrammer";
4
+ import { JsonStringifyProgrammer } from "typia/lib/programmers/json/JsonStringifyProgrammer";
5
+ import { JsonValidateStringifyProgrammer } from "typia/lib/programmers/json/JsonValidateStringifyProgrammer";
6
+ import { IProject } from "typia/lib/transformers/IProject";
7
+
8
+ import { INestiaTransformProject } from "../options/INestiaTransformProject";
9
+
10
+ export namespace TypedRouteProgrammer {
11
+ export const generate =
12
+ (project: INestiaTransformProject) =>
13
+ (modulo: ts.LeftHandSideExpression) =>
14
+ (type: ts.Type): ts.Expression => {
15
+ // GENERATE STRINGIFY PLAN
16
+ const parameter = (
17
+ key: string,
18
+ programmer: (
19
+ project: IProject,
20
+ ) => (
21
+ modulo: ts.LeftHandSideExpression,
22
+ ) => (type: ts.Type) => ts.ArrowFunction,
23
+ ) =>
24
+ ts.factory.createObjectLiteralExpression([
25
+ ts.factory.createPropertyAssignment(
26
+ ts.factory.createIdentifier("type"),
27
+ ts.factory.createStringLiteral(key),
28
+ ),
29
+ ts.factory.createPropertyAssignment(
30
+ ts.factory.createIdentifier(key),
31
+ programmer({
32
+ ...project,
33
+ options: {}, // use default option
34
+ })(modulo)(type),
35
+ ),
36
+ ]);
37
+
38
+ // RETURNS
39
+ if (project.options.stringify === "is")
40
+ return parameter("is", JsonIsStringifyProgrammer.write);
41
+ else if (project.options.stringify === "validate")
42
+ return parameter("validate", JsonValidateStringifyProgrammer.write);
43
+ else if (project.options.stringify === "stringify")
44
+ return parameter("stringify", JsonStringifyProgrammer.write);
45
+ else if (project.options.stringify === null)
46
+ return ts.factory.createNull();
47
+
48
+ // ASSERT IS DEFAULT
49
+ return parameter("assert", JsonAssertStringifyProgrammer.write);
50
+ };
51
+ }
@@ -1,58 +1,58 @@
1
- import ts from "typescript";
2
- import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
- import { StatementFactory } from "typia/lib/factories/StatementFactory";
4
- import { AssertProgrammer } from "typia/lib/programmers/AssertProgrammer";
5
- import { IProject } from "typia/lib/transformers/IProject";
6
-
7
- import { HttpQuerifyProgrammer } from "./HttpQuerifyProgrammer";
8
-
9
- export namespace HttpAssertQuerifyProgrammer {
10
- export const write =
11
- (project: IProject) =>
12
- (modulo: ts.LeftHandSideExpression) =>
13
- (type: ts.Type, name?: string): ts.ArrowFunction =>
14
- ts.factory.createArrowFunction(
15
- undefined,
16
- undefined,
17
- [IdentifierFactory.parameter("input")],
18
- undefined,
19
- undefined,
20
- ts.factory.createBlock([
21
- StatementFactory.constant(
22
- "assert",
23
- AssertProgrammer.write({
24
- ...project,
25
- options: {
26
- ...project.options,
27
- functional: false,
28
- numeric: false,
29
- },
30
- })(modulo)(false)(type, name),
31
- ),
32
- StatementFactory.constant(
33
- "stringify",
34
- HttpQuerifyProgrammer.write({
35
- ...project,
36
- options: {
37
- ...project.options,
38
- functional: false,
39
- numeric: false,
40
- },
41
- })(modulo)(type),
42
- ),
43
- ts.factory.createReturnStatement(
44
- ts.factory.createCallExpression(
45
- ts.factory.createIdentifier("stringify"),
46
- undefined,
47
- [
48
- ts.factory.createCallExpression(
49
- ts.factory.createIdentifier("assert"),
50
- undefined,
51
- [ts.factory.createIdentifier("input")],
52
- ),
53
- ],
54
- ),
55
- ),
56
- ]),
57
- );
58
- }
1
+ import ts from "typescript";
2
+ import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
+ import { StatementFactory } from "typia/lib/factories/StatementFactory";
4
+ import { AssertProgrammer } from "typia/lib/programmers/AssertProgrammer";
5
+ import { IProject } from "typia/lib/transformers/IProject";
6
+
7
+ import { HttpQuerifyProgrammer } from "./HttpQuerifyProgrammer";
8
+
9
+ export namespace HttpAssertQuerifyProgrammer {
10
+ export const write =
11
+ (project: IProject) =>
12
+ (modulo: ts.LeftHandSideExpression) =>
13
+ (type: ts.Type, name?: string): ts.ArrowFunction =>
14
+ ts.factory.createArrowFunction(
15
+ undefined,
16
+ undefined,
17
+ [IdentifierFactory.parameter("input")],
18
+ undefined,
19
+ undefined,
20
+ ts.factory.createBlock([
21
+ StatementFactory.constant(
22
+ "assert",
23
+ AssertProgrammer.write({
24
+ ...project,
25
+ options: {
26
+ ...project.options,
27
+ functional: false,
28
+ numeric: false,
29
+ },
30
+ })(modulo)(false)(type, name),
31
+ ),
32
+ StatementFactory.constant(
33
+ "stringify",
34
+ HttpQuerifyProgrammer.write({
35
+ ...project,
36
+ options: {
37
+ ...project.options,
38
+ functional: false,
39
+ numeric: false,
40
+ },
41
+ })(modulo)(type),
42
+ ),
43
+ ts.factory.createReturnStatement(
44
+ ts.factory.createCallExpression(
45
+ ts.factory.createIdentifier("stringify"),
46
+ undefined,
47
+ [
48
+ ts.factory.createCallExpression(
49
+ ts.factory.createIdentifier("assert"),
50
+ undefined,
51
+ [ts.factory.createIdentifier("input")],
52
+ ),
53
+ ],
54
+ ),
55
+ ),
56
+ ]),
57
+ );
58
+ }
@@ -1,62 +1,62 @@
1
- import ts from "typescript";
2
- import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
- import { StatementFactory } from "typia/lib/factories/StatementFactory";
4
- import { IsProgrammer } from "typia/lib/programmers/IsProgrammer";
5
- import { IProject } from "typia/lib/transformers/IProject";
6
-
7
- import { HttpQuerifyProgrammer } from "./HttpQuerifyProgrammer";
8
-
9
- export namespace HttpIsQuerifyProgrammer {
10
- export const write =
11
- (project: IProject) =>
12
- (modulo: ts.LeftHandSideExpression) =>
13
- (type: ts.Type): ts.ArrowFunction =>
14
- ts.factory.createArrowFunction(
15
- undefined,
16
- undefined,
17
- [IdentifierFactory.parameter("input")],
18
- undefined,
19
- undefined,
20
- ts.factory.createBlock([
21
- StatementFactory.constant(
22
- "is",
23
- IsProgrammer.write({
24
- ...project,
25
- options: {
26
- ...project.options,
27
- functional: false,
28
- numeric: false,
29
- },
30
- })(modulo)(false)(type),
31
- ),
32
- StatementFactory.constant(
33
- "stringify",
34
- HttpQuerifyProgrammer.write({
35
- ...project,
36
- options: {
37
- ...project.options,
38
- functional: false,
39
- numeric: false,
40
- },
41
- })(modulo)(type),
42
- ),
43
- ts.factory.createReturnStatement(
44
- ts.factory.createConditionalExpression(
45
- ts.factory.createCallExpression(
46
- ts.factory.createIdentifier("is"),
47
- undefined,
48
- [ts.factory.createIdentifier("input")],
49
- ),
50
- undefined,
51
- ts.factory.createCallExpression(
52
- ts.factory.createIdentifier("stringify"),
53
- undefined,
54
- [ts.factory.createIdentifier("input")],
55
- ),
56
- undefined,
57
- ts.factory.createNull(),
58
- ),
59
- ),
60
- ]),
61
- );
62
- }
1
+ import ts from "typescript";
2
+ import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
+ import { StatementFactory } from "typia/lib/factories/StatementFactory";
4
+ import { IsProgrammer } from "typia/lib/programmers/IsProgrammer";
5
+ import { IProject } from "typia/lib/transformers/IProject";
6
+
7
+ import { HttpQuerifyProgrammer } from "./HttpQuerifyProgrammer";
8
+
9
+ export namespace HttpIsQuerifyProgrammer {
10
+ export const write =
11
+ (project: IProject) =>
12
+ (modulo: ts.LeftHandSideExpression) =>
13
+ (type: ts.Type): ts.ArrowFunction =>
14
+ ts.factory.createArrowFunction(
15
+ undefined,
16
+ undefined,
17
+ [IdentifierFactory.parameter("input")],
18
+ undefined,
19
+ undefined,
20
+ ts.factory.createBlock([
21
+ StatementFactory.constant(
22
+ "is",
23
+ IsProgrammer.write({
24
+ ...project,
25
+ options: {
26
+ ...project.options,
27
+ functional: false,
28
+ numeric: false,
29
+ },
30
+ })(modulo)(false)(type),
31
+ ),
32
+ StatementFactory.constant(
33
+ "stringify",
34
+ HttpQuerifyProgrammer.write({
35
+ ...project,
36
+ options: {
37
+ ...project.options,
38
+ functional: false,
39
+ numeric: false,
40
+ },
41
+ })(modulo)(type),
42
+ ),
43
+ ts.factory.createReturnStatement(
44
+ ts.factory.createConditionalExpression(
45
+ ts.factory.createCallExpression(
46
+ ts.factory.createIdentifier("is"),
47
+ undefined,
48
+ [ts.factory.createIdentifier("input")],
49
+ ),
50
+ undefined,
51
+ ts.factory.createCallExpression(
52
+ ts.factory.createIdentifier("stringify"),
53
+ undefined,
54
+ [ts.factory.createIdentifier("input")],
55
+ ),
56
+ undefined,
57
+ ts.factory.createNull(),
58
+ ),
59
+ ),
60
+ ]),
61
+ );
62
+ }
@@ -1,63 +1,63 @@
1
- import ts from "typescript";
2
- import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
- import { StatementFactory } from "typia/lib/factories/StatementFactory";
4
- import { ValidateProgrammer } from "typia/lib/programmers/ValidateProgrammer";
5
- import { IProject } from "typia/lib/transformers/IProject";
6
-
7
- import { HttpQuerifyProgrammer } from "./HttpQuerifyProgrammer";
8
-
9
- export namespace HttpValidateQuerifyProgrammer {
10
- export const write =
11
- (project: IProject) =>
12
- (modulo: ts.LeftHandSideExpression) =>
13
- (type: ts.Type, name?: string): ts.ArrowFunction =>
14
- ts.factory.createArrowFunction(
15
- undefined,
16
- undefined,
17
- [IdentifierFactory.parameter("input")],
18
- undefined,
19
- undefined,
20
- ts.factory.createBlock([
21
- StatementFactory.constant(
22
- "validate",
23
- ValidateProgrammer.write({
24
- ...project,
25
- options: {
26
- ...project.options,
27
- functional: false,
28
- numeric: true,
29
- },
30
- })(modulo)(false)(type, name),
31
- ),
32
- StatementFactory.constant(
33
- "query",
34
- HttpQuerifyProgrammer.write({
35
- ...project,
36
- options: {
37
- ...project.options,
38
- functional: false,
39
- numeric: false,
40
- },
41
- })(modulo)(type),
42
- ),
43
- StatementFactory.constant(
44
- "output",
45
- ts.factory.createCallExpression(
46
- ts.factory.createIdentifier("query"),
47
- undefined,
48
- [ts.factory.createIdentifier("input")],
49
- ),
50
- ),
51
- ts.factory.createReturnStatement(
52
- ts.factory.createAsExpression(
53
- ts.factory.createCallExpression(
54
- ts.factory.createIdentifier("validate"),
55
- undefined,
56
- [ts.factory.createIdentifier("output")],
57
- ),
58
- ts.factory.createTypeReferenceNode("any"),
59
- ),
60
- ),
61
- ]),
62
- );
63
- }
1
+ import ts from "typescript";
2
+ import { IdentifierFactory } from "typia/lib/factories/IdentifierFactory";
3
+ import { StatementFactory } from "typia/lib/factories/StatementFactory";
4
+ import { ValidateProgrammer } from "typia/lib/programmers/ValidateProgrammer";
5
+ import { IProject } from "typia/lib/transformers/IProject";
6
+
7
+ import { HttpQuerifyProgrammer } from "./HttpQuerifyProgrammer";
8
+
9
+ export namespace HttpValidateQuerifyProgrammer {
10
+ export const write =
11
+ (project: IProject) =>
12
+ (modulo: ts.LeftHandSideExpression) =>
13
+ (type: ts.Type, name?: string): ts.ArrowFunction =>
14
+ ts.factory.createArrowFunction(
15
+ undefined,
16
+ undefined,
17
+ [IdentifierFactory.parameter("input")],
18
+ undefined,
19
+ undefined,
20
+ ts.factory.createBlock([
21
+ StatementFactory.constant(
22
+ "validate",
23
+ ValidateProgrammer.write({
24
+ ...project,
25
+ options: {
26
+ ...project.options,
27
+ functional: false,
28
+ numeric: true,
29
+ },
30
+ })(modulo)(false)(type, name),
31
+ ),
32
+ StatementFactory.constant(
33
+ "query",
34
+ HttpQuerifyProgrammer.write({
35
+ ...project,
36
+ options: {
37
+ ...project.options,
38
+ functional: false,
39
+ numeric: false,
40
+ },
41
+ })(modulo)(type),
42
+ ),
43
+ StatementFactory.constant(
44
+ "output",
45
+ ts.factory.createCallExpression(
46
+ ts.factory.createIdentifier("query"),
47
+ undefined,
48
+ [ts.factory.createIdentifier("input")],
49
+ ),
50
+ ),
51
+ ts.factory.createReturnStatement(
52
+ ts.factory.createAsExpression(
53
+ ts.factory.createCallExpression(
54
+ ts.factory.createIdentifier("validate"),
55
+ undefined,
56
+ [ts.factory.createIdentifier("output")],
57
+ ),
58
+ ts.factory.createTypeReferenceNode("any"),
59
+ ),
60
+ ),
61
+ ]),
62
+ );
63
+ }
@@ -1,21 +1,21 @@
1
- import { Metadata } from "typia/lib/schemas/metadata/Metadata";
2
-
3
- export namespace CoreMetadataUtil {
4
- export const atomics = (
5
- meta: Metadata,
6
- ): Set<"boolean" | "bigint" | "number" | "string"> =>
7
- new Set([
8
- ...meta.atomics.map((a) => a.type),
9
- ...meta.constants.map((c) => c.type),
10
- ...(meta.templates.length ? (["string"] as const) : []),
11
- ]);
12
-
13
- export const isUnion = (meta: Metadata): boolean =>
14
- atomics(meta).size +
15
- meta.arrays.length +
16
- meta.tuples.length +
17
- meta.natives.length +
18
- meta.maps.length +
19
- meta.objects.length >
20
- 1;
21
- }
1
+ import { Metadata } from "typia/lib/schemas/metadata/Metadata";
2
+
3
+ export namespace CoreMetadataUtil {
4
+ export const atomics = (
5
+ meta: Metadata,
6
+ ): Set<"boolean" | "bigint" | "number" | "string"> =>
7
+ new Set([
8
+ ...meta.atomics.map((a) => a.type),
9
+ ...meta.constants.map((c) => c.type),
10
+ ...(meta.templates.length ? (["string"] as const) : []),
11
+ ]);
12
+
13
+ export const isUnion = (meta: Metadata): boolean =>
14
+ atomics(meta).size +
15
+ meta.arrays.length +
16
+ meta.tuples.length +
17
+ meta.natives.length +
18
+ meta.maps.length +
19
+ meta.objects.length >
20
+ 1;
21
+ }
package/src/transform.ts CHANGED
@@ -1,35 +1,35 @@
1
- import ts from "typescript";
2
- import { IProject } from "typia/lib/transformers/IProject";
3
-
4
- import { INestiaTransformOptions } from "./options/INestiaTransformOptions";
5
- import { FileTransformer } from "./transformers/FileTransformer";
6
-
7
- export const transform = (
8
- program: ts.Program,
9
- options: INestiaTransformOptions | undefined,
10
- extras: IProject["extras"],
11
- ): ts.TransformerFactory<ts.SourceFile> => {
12
- const compilerOptions: ts.CompilerOptions = program.getCompilerOptions();
13
- const strict: boolean =
14
- compilerOptions.strictNullChecks !== undefined
15
- ? !!compilerOptions.strictNullChecks
16
- : !!compilerOptions.strict;
17
- if (strict === false)
18
- extras.addDiagnostic({
19
- category: ts.DiagnosticCategory.Error,
20
- code: "(@nestia/core)" as any,
21
- file: undefined,
22
- start: undefined,
23
- length: undefined,
24
- messageText: "strict mode is required.",
25
- });
26
- return FileTransformer.transform({
27
- program,
28
- compilerOptions,
29
- checker: program.getTypeChecker(),
30
- printer: ts.createPrinter(),
31
- options: options ?? {},
32
- extras,
33
- });
34
- };
35
- export default transform;
1
+ import ts from "typescript";
2
+ import { IProject } from "typia/lib/transformers/IProject";
3
+
4
+ import { INestiaTransformOptions } from "./options/INestiaTransformOptions";
5
+ import { FileTransformer } from "./transformers/FileTransformer";
6
+
7
+ export const transform = (
8
+ program: ts.Program,
9
+ options: INestiaTransformOptions | undefined,
10
+ extras: IProject["extras"],
11
+ ): ts.TransformerFactory<ts.SourceFile> => {
12
+ const compilerOptions: ts.CompilerOptions = program.getCompilerOptions();
13
+ const strict: boolean =
14
+ compilerOptions.strictNullChecks !== undefined
15
+ ? !!compilerOptions.strictNullChecks
16
+ : !!compilerOptions.strict;
17
+ if (strict === false)
18
+ extras.addDiagnostic({
19
+ category: ts.DiagnosticCategory.Error,
20
+ code: "(@nestia/core)" as any,
21
+ file: undefined,
22
+ start: undefined,
23
+ length: undefined,
24
+ messageText: "strict mode is required.",
25
+ });
26
+ return FileTransformer.transform({
27
+ program,
28
+ compilerOptions,
29
+ checker: program.getTypeChecker(),
30
+ printer: ts.createPrinter(),
31
+ options: options ?? {},
32
+ extras,
33
+ });
34
+ };
35
+ export default transform;