@kubb/plugin-zod 5.4.0 → 5.4.1
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/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -737,6 +737,7 @@ function mapSchemaItems(node, transform) {
|
|
|
737
737
|
//#region src/components/Zod.tsx
|
|
738
738
|
function Zod({ name, node, printer, inferTypeName, typeGuards, isName, assertName, mini, cyclic, compile }) {
|
|
739
739
|
const output = printer.print(node);
|
|
740
|
+
const printerImports = printer.drainImports();
|
|
740
741
|
if (!output) return;
|
|
741
742
|
const needsAnnotation = cyclic && node.type !== "object";
|
|
742
743
|
const isBare = ast.isBareRef(node, printer.options.keysToOmit);
|
|
@@ -746,6 +747,17 @@ function Zod({ name, node, printer, inferTypeName, typeGuards, isName, assertNam
|
|
|
746
747
|
const shouldGenerateIs = isName && (typeof typeGuards === "object" ? typeGuards.is ?? true : Boolean(typeGuards));
|
|
747
748
|
const shouldGenerateAssert = assertName && (typeof typeGuards === "object" ? typeGuards.assert ?? true : Boolean(typeGuards));
|
|
748
749
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
750
|
+
printerImports.map((imp) => /* @__PURE__ */ jsx(File.Import, {
|
|
751
|
+
name: imp.name,
|
|
752
|
+
path: imp.path,
|
|
753
|
+
root: imp.root,
|
|
754
|
+
isTypeOnly: imp.isTypeOnly,
|
|
755
|
+
isNameSpace: imp.isNameSpace
|
|
756
|
+
}, [
|
|
757
|
+
name,
|
|
758
|
+
imp.path,
|
|
759
|
+
imp.name
|
|
760
|
+
].join("-"))),
|
|
749
761
|
/* @__PURE__ */ jsx(File.Source, {
|
|
750
762
|
name,
|
|
751
763
|
isExportable: true,
|
|
@@ -1195,7 +1207,8 @@ function variesByDirection({ node, printerOptions }) {
|
|
|
1195
1207
|
direction
|
|
1196
1208
|
},
|
|
1197
1209
|
transform: () => null,
|
|
1198
|
-
base: () => null
|
|
1210
|
+
base: () => null,
|
|
1211
|
+
import: () => {}
|
|
1199
1212
|
};
|
|
1200
1213
|
return handler.call(context, node);
|
|
1201
1214
|
};
|