@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.js
CHANGED
|
@@ -809,9 +809,6 @@ function shouldCoerce(coercion, type) {
|
|
|
809
809
|
if (coercion === true) return true;
|
|
810
810
|
return !!coercion[type];
|
|
811
811
|
}
|
|
812
|
-
function propertyNamesOf(node) {
|
|
813
|
-
return "propertyNames" in node ? node.propertyNames : void 0;
|
|
814
|
-
}
|
|
815
812
|
/**
|
|
816
813
|
* Whether the schema node represents a closed or finite set of keys (e.g. enum, literal,
|
|
817
814
|
* or union of enums/literals).
|
|
@@ -840,7 +837,7 @@ function isPlainInlineObject(node) {
|
|
|
840
837
|
if (node.nullable || node.optional || node.nullish) return false;
|
|
841
838
|
const hasAdditionalProperties = node.additionalProperties !== void 0;
|
|
842
839
|
const hasPatternProperties = Boolean(node.patternProperties);
|
|
843
|
-
return !hasAdditionalProperties && !hasPatternProperties && !
|
|
840
|
+
return !hasAdditionalProperties && !hasPatternProperties && !node.propertyNames;
|
|
844
841
|
}
|
|
845
842
|
/**
|
|
846
843
|
* Whether a node renders as a bare Zod object — one that accepts `.extend(…)` and can be a
|
|
@@ -855,7 +852,7 @@ function isObjectSchemaNode(node, cyclicSchemas) {
|
|
|
855
852
|
const hasProperties = Boolean(node.properties?.length);
|
|
856
853
|
const hasTypedAdditionalProperties = Boolean(node.additionalProperties && node.additionalProperties !== true);
|
|
857
854
|
const hasPatternProperties = Boolean(node.patternProperties);
|
|
858
|
-
return !(!hasProperties && (hasTypedAdditionalProperties || hasPatternProperties ||
|
|
855
|
+
return !(!hasProperties && (hasTypedAdditionalProperties || hasPatternProperties || node.propertyNames));
|
|
859
856
|
}
|
|
860
857
|
if (node.type === "ref") {
|
|
861
858
|
const refName = ast.resolveRefName(node);
|
|
@@ -1238,7 +1235,7 @@ function containsDirectionalNode({ node, printerOptions, seen = /* @__PURE__ */
|
|
|
1238
1235
|
if ("items" in node && node.items) children.push(...node.items);
|
|
1239
1236
|
if ("members" in node && node.members) children.push(...node.members);
|
|
1240
1237
|
if ("additionalProperties" in node && node.additionalProperties && node.additionalProperties !== true) children.push(node.additionalProperties);
|
|
1241
|
-
const propertyNames =
|
|
1238
|
+
const propertyNames = node.type === "object" ? node.propertyNames : void 0;
|
|
1242
1239
|
if (propertyNames) children.push(propertyNames);
|
|
1243
1240
|
return children.some((child) => containsDirectionalNode({
|
|
1244
1241
|
node: child,
|
|
@@ -1383,7 +1380,7 @@ const printerZod = ast.createPrinter((options) => {
|
|
|
1383
1380
|
object(node) {
|
|
1384
1381
|
const entries = node.properties ?? [];
|
|
1385
1382
|
const patterns = node.patternProperties ? Object.entries(node.patternProperties) : [];
|
|
1386
|
-
const propertyNamesNode =
|
|
1383
|
+
const propertyNamesNode = node.propertyNames;
|
|
1387
1384
|
const propertyNamesKeySchema = propertyNamesNode ? this.transform(propertyNamesNode) : null;
|
|
1388
1385
|
const isStrict = node.additionalProperties === false && patterns.length === 0;
|
|
1389
1386
|
const isLoose = node.additionalProperties === true;
|
|
@@ -1593,7 +1590,7 @@ const printerZodMini = ast.createPrinter((options) => {
|
|
|
1593
1590
|
object(node) {
|
|
1594
1591
|
const entries = node.properties ?? [];
|
|
1595
1592
|
const patterns = node.patternProperties ? Object.entries(node.patternProperties) : [];
|
|
1596
|
-
const propertyNamesNode =
|
|
1593
|
+
const propertyNamesNode = node.propertyNames;
|
|
1597
1594
|
const propertyNamesKeySchema = propertyNamesNode ? this.transform(propertyNamesNode) : null;
|
|
1598
1595
|
const isStrict = node.additionalProperties === false && patterns.length === 0;
|
|
1599
1596
|
const isLoose = node.additionalProperties === true;
|
|
@@ -2148,7 +2145,7 @@ var compatibility = {
|
|
|
2148
2145
|
};
|
|
2149
2146
|
//#endregion
|
|
2150
2147
|
//#region package.json
|
|
2151
|
-
var version = "5.7.
|
|
2148
|
+
var version = "5.7.2";
|
|
2152
2149
|
//#endregion
|
|
2153
2150
|
//#region src/resolvers/resolverZod.ts
|
|
2154
2151
|
/**
|