@nestia/core 1.3.3 → 1.3.5
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/transform.js +7 -1
- package/lib/transform.js.map +1 -1
- package/package.json +6 -6
- package/src/transform.ts +13 -3
package/lib/transform.js
CHANGED
|
@@ -7,9 +7,15 @@ exports.transform = void 0;
|
|
|
7
7
|
var typescript_1 = __importDefault(require("typescript"));
|
|
8
8
|
var FileTransformer_1 = require("./transformers/FileTransformer");
|
|
9
9
|
var transform = function (program, options) {
|
|
10
|
+
var compilerOptions = program.getCompilerOptions();
|
|
11
|
+
var strict = compilerOptions.strictNullChecks !== undefined
|
|
12
|
+
? !!compilerOptions.strictNullChecks
|
|
13
|
+
: !!compilerOptions.strict;
|
|
14
|
+
if (strict === false)
|
|
15
|
+
throw new Error("Error on \"tsconfig.json\": nestia requires `compilerOptions.strictNullChecks` to be true.");
|
|
10
16
|
return FileTransformer_1.FileTransformer.transform({
|
|
11
17
|
program: program,
|
|
12
|
-
compilerOptions:
|
|
18
|
+
compilerOptions: compilerOptions,
|
|
13
19
|
checker: program.getTypeChecker(),
|
|
14
20
|
printer: typescript_1.default.createPrinter(),
|
|
15
21
|
options: options || {},
|
package/lib/transform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAG5B,kEAAiE;AAE1D,IAAM,SAAS,GAAG,UACrB,OAAmB,EACnB,OAAiC;IAEjC,
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAG5B,kEAAiE;AAE1D,IAAM,SAAS,GAAG,UACrB,OAAmB,EACnB,OAAiC;IAEjC,IAAM,eAAe,GAAuB,OAAO,CAAC,kBAAkB,EAAE,CAAC;IACzE,IAAM,MAAM,GACR,eAAe,CAAC,gBAAgB,KAAK,SAAS;QAC1C,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,gBAAgB;QACpC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC;IACnC,IAAI,MAAM,KAAK,KAAK;QAChB,MAAM,IAAI,KAAK,CACX,4FAA4F,CAC/F,CAAC;IACN,OAAO,iCAAe,CAAC,SAAS,CAAC;QAC7B,OAAO,SAAA;QACP,eAAe,iBAAA;QACf,OAAO,EAAE,OAAO,CAAC,cAAc,EAAE;QACjC,OAAO,EAAE,oBAAE,CAAC,aAAa,EAAE;QAC3B,OAAO,EAAE,OAAO,IAAI,EAAE;KACzB,CAAC,CAAC;AACP,CAAC,CAAC;AApBW,QAAA,SAAS,aAoBpB;AACF,kBAAe,iBAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Super-fast validation decorators of NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://nestia.io",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nestia/fetcher": "^1.
|
|
37
|
+
"@nestia/fetcher": "^1.3.3",
|
|
38
38
|
"@nestjs/common": ">= 7.0.1",
|
|
39
39
|
"@nestjs/core": ">= 7.0.1",
|
|
40
40
|
"@nestjs/platform-express": ">= 7.0.1",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"raw-body": ">= 2.0.0",
|
|
45
45
|
"reflect-metadata": ">= 0.1.12",
|
|
46
46
|
"rxjs": ">= 6.0.0",
|
|
47
|
-
"typia": "^4.0.
|
|
47
|
+
"typia": "^4.0.6"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@nestia/fetcher": "
|
|
50
|
+
"@nestia/fetcher": ">= 1.3.3",
|
|
51
51
|
"@nestjs/common": ">= 7.0.1",
|
|
52
52
|
"@nestjs/core": ">= 7.0.1",
|
|
53
53
|
"@nestjs/platform-express": ">= 7.0.1",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"raw-body": ">= 2.0.0",
|
|
56
56
|
"reflect-metadata": ">= 0.1.12",
|
|
57
57
|
"rxjs": ">= 6.0.0",
|
|
58
|
-
"typescript": ">= 4.
|
|
59
|
-
"typia": ">= 4.0.
|
|
58
|
+
"typescript": ">= 4.7.4",
|
|
59
|
+
"typia": ">= 4.0.6"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
|
package/src/transform.ts
CHANGED
|
@@ -6,12 +6,22 @@ import { FileTransformer } from "./transformers/FileTransformer";
|
|
|
6
6
|
export const transform = (
|
|
7
7
|
program: ts.Program,
|
|
8
8
|
options?: INestiaTransformOptions,
|
|
9
|
-
): ts.TransformerFactory<ts.SourceFile> =>
|
|
10
|
-
|
|
9
|
+
): ts.TransformerFactory<ts.SourceFile> => {
|
|
10
|
+
const compilerOptions: ts.CompilerOptions = program.getCompilerOptions();
|
|
11
|
+
const strict: boolean =
|
|
12
|
+
compilerOptions.strictNullChecks !== undefined
|
|
13
|
+
? !!compilerOptions.strictNullChecks
|
|
14
|
+
: !!compilerOptions.strict;
|
|
15
|
+
if (strict === false)
|
|
16
|
+
throw new Error(
|
|
17
|
+
`Error on "tsconfig.json": nestia requires \`compilerOptions.strictNullChecks\` to be true.`,
|
|
18
|
+
);
|
|
19
|
+
return FileTransformer.transform({
|
|
11
20
|
program,
|
|
12
|
-
compilerOptions
|
|
21
|
+
compilerOptions,
|
|
13
22
|
checker: program.getTypeChecker(),
|
|
14
23
|
printer: ts.createPrinter(),
|
|
15
24
|
options: options || {},
|
|
16
25
|
});
|
|
26
|
+
};
|
|
17
27
|
export default transform;
|