@kubb/plugin-zod 5.7.1 → 5.7.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.
- package/dist/index.cjs +6 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -813,9 +813,6 @@ function shouldCoerce(coercion, type) {
|
|
|
813
813
|
if (coercion === true) return true;
|
|
814
814
|
return !!coercion[type];
|
|
815
815
|
}
|
|
816
|
-
function propertyNamesOf(node) {
|
|
817
|
-
return "propertyNames" in node ? node.propertyNames : void 0;
|
|
818
|
-
}
|
|
819
816
|
/**
|
|
820
817
|
* Whether the schema node represents a closed or finite set of keys (e.g. enum, literal,
|
|
821
818
|
* or union of enums/literals).
|
|
@@ -844,7 +841,7 @@ function isPlainInlineObject(node) {
|
|
|
844
841
|
if (node.nullable || node.optional || node.nullish) return false;
|
|
845
842
|
const hasAdditionalProperties = node.additionalProperties !== void 0;
|
|
846
843
|
const hasPatternProperties = Boolean(node.patternProperties);
|
|
847
|
-
return !hasAdditionalProperties && !hasPatternProperties && !
|
|
844
|
+
return !hasAdditionalProperties && !hasPatternProperties && !node.propertyNames;
|
|
848
845
|
}
|
|
849
846
|
/**
|
|
850
847
|
* Whether a node renders as a bare Zod object — one that accepts `.extend(…)` and can be a
|
|
@@ -859,7 +856,7 @@ function isObjectSchemaNode(node, cyclicSchemas) {
|
|
|
859
856
|
const hasProperties = Boolean(node.properties?.length);
|
|
860
857
|
const hasTypedAdditionalProperties = Boolean(node.additionalProperties && node.additionalProperties !== true);
|
|
861
858
|
const hasPatternProperties = Boolean(node.patternProperties);
|
|
862
|
-
return !(!hasProperties && (hasTypedAdditionalProperties || hasPatternProperties ||
|
|
859
|
+
return !(!hasProperties && (hasTypedAdditionalProperties || hasPatternProperties || node.propertyNames));
|
|
863
860
|
}
|
|
864
861
|
if (node.type === "ref") {
|
|
865
862
|
const refName = kubb_kit.ast.resolveRefName(node);
|
|
@@ -1242,7 +1239,7 @@ function containsDirectionalNode({ node, printerOptions, seen = /* @__PURE__ */
|
|
|
1242
1239
|
if ("items" in node && node.items) children.push(...node.items);
|
|
1243
1240
|
if ("members" in node && node.members) children.push(...node.members);
|
|
1244
1241
|
if ("additionalProperties" in node && node.additionalProperties && node.additionalProperties !== true) children.push(node.additionalProperties);
|
|
1245
|
-
const propertyNames =
|
|
1242
|
+
const propertyNames = node.type === "object" ? node.propertyNames : void 0;
|
|
1246
1243
|
if (propertyNames) children.push(propertyNames);
|
|
1247
1244
|
return children.some((child) => containsDirectionalNode({
|
|
1248
1245
|
node: child,
|
|
@@ -1387,7 +1384,7 @@ const printerZod = kubb_kit.ast.createPrinter((options) => {
|
|
|
1387
1384
|
object(node) {
|
|
1388
1385
|
const entries = node.properties ?? [];
|
|
1389
1386
|
const patterns = node.patternProperties ? Object.entries(node.patternProperties) : [];
|
|
1390
|
-
const propertyNamesNode =
|
|
1387
|
+
const propertyNamesNode = node.propertyNames;
|
|
1391
1388
|
const propertyNamesKeySchema = propertyNamesNode ? this.transform(propertyNamesNode) : null;
|
|
1392
1389
|
const isStrict = node.additionalProperties === false && patterns.length === 0;
|
|
1393
1390
|
const isLoose = node.additionalProperties === true;
|
|
@@ -1597,7 +1594,7 @@ const printerZodMini = kubb_kit.ast.createPrinter((options) => {
|
|
|
1597
1594
|
object(node) {
|
|
1598
1595
|
const entries = node.properties ?? [];
|
|
1599
1596
|
const patterns = node.patternProperties ? Object.entries(node.patternProperties) : [];
|
|
1600
|
-
const propertyNamesNode =
|
|
1597
|
+
const propertyNamesNode = node.propertyNames;
|
|
1601
1598
|
const propertyNamesKeySchema = propertyNamesNode ? this.transform(propertyNamesNode) : null;
|
|
1602
1599
|
const isStrict = node.additionalProperties === false && patterns.length === 0;
|
|
1603
1600
|
const isLoose = node.additionalProperties === true;
|
|
@@ -2152,7 +2149,7 @@ var compatibility = {
|
|
|
2152
2149
|
};
|
|
2153
2150
|
//#endregion
|
|
2154
2151
|
//#region package.json
|
|
2155
|
-
var version = "5.7.
|
|
2152
|
+
var version = "5.7.2";
|
|
2156
2153
|
//#endregion
|
|
2157
2154
|
//#region src/resolvers/resolverZod.ts
|
|
2158
2155
|
/**
|