@dudousxd/nestjs-codegen 0.22.1 → 0.23.0
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/CHANGELOG.md +14 -0
- package/dist/cli/main.cjs +7 -1
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +7 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +7 -1
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +7 -1
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nest/index.js
CHANGED
|
@@ -975,6 +975,7 @@ function classifyTypeKeyword(raw) {
|
|
|
975
975
|
function markNullable(r, nullable) {
|
|
976
976
|
return nullable ? { ...r, nullable: true } : r;
|
|
977
977
|
}
|
|
978
|
+
var TRANSPARENT_TYPE_BRANDS = /* @__PURE__ */ new Set(["Opt", "Hidden"]);
|
|
978
979
|
function classifyTypeNode(typeNode, sourceFile, project, opts) {
|
|
979
980
|
if (Node3.isUnionTypeNode(typeNode)) {
|
|
980
981
|
let nullable = false;
|
|
@@ -1033,6 +1034,11 @@ function classifyTypeNode(typeNode, sourceFile, project, opts) {
|
|
|
1033
1034
|
const refName = typeNode.getTypeName().getText();
|
|
1034
1035
|
if (refName === "Date") return { kind: "date" };
|
|
1035
1036
|
if (refName === "Record" || refName === "Object") return { kind: "json" };
|
|
1037
|
+
const unwrapped = TRANSPARENT_TYPE_BRANDS.has(refName) ? typeNode.getTypeArguments()[0] : void 0;
|
|
1038
|
+
if (unwrapped) {
|
|
1039
|
+
const inner = classifyTypeNode(unwrapped, sourceFile, project, opts);
|
|
1040
|
+
return inner;
|
|
1041
|
+
}
|
|
1036
1042
|
const typeRef = opts?.resolveRef?.(refName) ?? null;
|
|
1037
1043
|
const en = resolveEnumValues(refName, sourceFile, project);
|
|
1038
1044
|
if (en) {
|
|
@@ -5016,7 +5022,7 @@ async function watch(config, onChange, options = {}) {
|
|
|
5016
5022
|
}
|
|
5017
5023
|
|
|
5018
5024
|
// src/index.ts
|
|
5019
|
-
var VERSION = "0.
|
|
5025
|
+
var VERSION = "0.23.0";
|
|
5020
5026
|
|
|
5021
5027
|
// src/generate-manifest.ts
|
|
5022
5028
|
var MANIFEST_FILE = ".codegen-manifest.json";
|