@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/cli/main.js
CHANGED
|
@@ -1351,6 +1351,7 @@ function classifyTypeKeyword(raw) {
|
|
|
1351
1351
|
function markNullable(r, nullable) {
|
|
1352
1352
|
return nullable ? { ...r, nullable: true } : r;
|
|
1353
1353
|
}
|
|
1354
|
+
var TRANSPARENT_TYPE_BRANDS = /* @__PURE__ */ new Set(["Opt", "Hidden"]);
|
|
1354
1355
|
function classifyTypeNode(typeNode, sourceFile, project, opts) {
|
|
1355
1356
|
if (Node4.isUnionTypeNode(typeNode)) {
|
|
1356
1357
|
let nullable = false;
|
|
@@ -1409,6 +1410,11 @@ function classifyTypeNode(typeNode, sourceFile, project, opts) {
|
|
|
1409
1410
|
const refName = typeNode.getTypeName().getText();
|
|
1410
1411
|
if (refName === "Date") return { kind: "date" };
|
|
1411
1412
|
if (refName === "Record" || refName === "Object") return { kind: "json" };
|
|
1413
|
+
const unwrapped = TRANSPARENT_TYPE_BRANDS.has(refName) ? typeNode.getTypeArguments()[0] : void 0;
|
|
1414
|
+
if (unwrapped) {
|
|
1415
|
+
const inner = classifyTypeNode(unwrapped, sourceFile, project, opts);
|
|
1416
|
+
return inner;
|
|
1417
|
+
}
|
|
1412
1418
|
const typeRef = opts?.resolveRef?.(refName) ?? null;
|
|
1413
1419
|
const en = resolveEnumValues(refName, sourceFile, project);
|
|
1414
1420
|
if (en) {
|
|
@@ -5235,7 +5241,7 @@ async function watch(config, onChange, options = {}) {
|
|
|
5235
5241
|
}
|
|
5236
5242
|
|
|
5237
5243
|
// src/index.ts
|
|
5238
|
-
var VERSION = "0.
|
|
5244
|
+
var VERSION = "0.23.0";
|
|
5239
5245
|
|
|
5240
5246
|
// src/cli/codegen.ts
|
|
5241
5247
|
async function runCodegen(opts = {}) {
|