zod 4.1.10 → 4.1.11
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/package.json +1 -1
- package/src/v4/classic/schemas.ts +1 -1
- package/src/v4/core/schemas.ts +1 -1
- package/src/v4/core/versions.ts +1 -1
- package/src/v4/mini/schemas.ts +1 -1
- package/v4/classic/schemas.cjs +1 -1
- package/v4/classic/schemas.js +1 -1
- package/v4/core/schemas.cjs +1 -1
- package/v4/core/schemas.js +1 -1
- package/v4/core/versions.cjs +1 -1
- package/v4/core/versions.js +1 -1
- package/v4/mini/schemas.cjs +1 -1
- package/v4/mini/schemas.js +1 -1
package/package.json
CHANGED
|
@@ -1224,7 +1224,7 @@ export function object<T extends core.$ZodLooseShape = Partial<Record<never, cor
|
|
|
1224
1224
|
): ZodObject<util.Writeable<T>, core.$strip> {
|
|
1225
1225
|
const def: core.$ZodObjectDef = {
|
|
1226
1226
|
type: "object",
|
|
1227
|
-
shape: shape
|
|
1227
|
+
shape: shape ?? {},
|
|
1228
1228
|
...util.normalizeParams(params),
|
|
1229
1229
|
};
|
|
1230
1230
|
return new ZodObject(def) as any;
|
package/src/v4/core/schemas.ts
CHANGED
|
@@ -1827,7 +1827,7 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
|
|
|
1827
1827
|
$ZodType.init(inst, def);
|
|
1828
1828
|
// const sh = def.shape;
|
|
1829
1829
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1830
|
-
if (!desc
|
|
1830
|
+
if (!desc?.get) {
|
|
1831
1831
|
const sh = def.shape;
|
|
1832
1832
|
Object.defineProperty(def, "shape", {
|
|
1833
1833
|
get: () => {
|
package/src/v4/core/versions.ts
CHANGED
package/src/v4/mini/schemas.ts
CHANGED
|
@@ -769,7 +769,7 @@ export function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(
|
|
|
769
769
|
): ZodMiniObject<T, core.$strip> {
|
|
770
770
|
const def: core.$ZodObjectDef = {
|
|
771
771
|
type: "object",
|
|
772
|
-
shape: shape
|
|
772
|
+
shape: shape ?? {},
|
|
773
773
|
...util.normalizeParams(params),
|
|
774
774
|
};
|
|
775
775
|
return new ZodMiniObject(def) as any;
|
package/v4/classic/schemas.cjs
CHANGED
|
@@ -652,7 +652,7 @@ exports.ZodObject = core.$constructor("ZodObject", (inst, def) => {
|
|
|
652
652
|
function object(shape, params) {
|
|
653
653
|
const def = {
|
|
654
654
|
type: "object",
|
|
655
|
-
shape: shape,
|
|
655
|
+
shape: shape ?? {},
|
|
656
656
|
...index_js_1.util.normalizeParams(params),
|
|
657
657
|
};
|
|
658
658
|
return new exports.ZodObject(def);
|
package/v4/classic/schemas.js
CHANGED
|
@@ -538,7 +538,7 @@ export const ZodObject = /*@__PURE__*/ core.$constructor("ZodObject", (inst, def
|
|
|
538
538
|
export function object(shape, params) {
|
|
539
539
|
const def = {
|
|
540
540
|
type: "object",
|
|
541
|
-
shape: shape,
|
|
541
|
+
shape: shape ?? {},
|
|
542
542
|
...util.normalizeParams(params),
|
|
543
543
|
};
|
|
544
544
|
return new ZodObject(def);
|
package/v4/core/schemas.cjs
CHANGED
|
@@ -802,7 +802,7 @@ exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
|
|
|
802
802
|
exports.$ZodType.init(inst, def);
|
|
803
803
|
// const sh = def.shape;
|
|
804
804
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
805
|
-
if (!desc
|
|
805
|
+
if (!desc?.get) {
|
|
806
806
|
const sh = def.shape;
|
|
807
807
|
Object.defineProperty(def, "shape", {
|
|
808
808
|
get: () => {
|
package/v4/core/schemas.js
CHANGED
|
@@ -771,7 +771,7 @@ export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, d
|
|
|
771
771
|
$ZodType.init(inst, def);
|
|
772
772
|
// const sh = def.shape;
|
|
773
773
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
774
|
-
if (!desc
|
|
774
|
+
if (!desc?.get) {
|
|
775
775
|
const sh = def.shape;
|
|
776
776
|
Object.defineProperty(def, "shape", {
|
|
777
777
|
get: () => {
|
package/v4/core/versions.cjs
CHANGED
package/v4/core/versions.js
CHANGED
package/v4/mini/schemas.cjs
CHANGED
|
@@ -474,7 +474,7 @@ exports.ZodMiniObject = core.$constructor("ZodMiniObject", (inst, def) => {
|
|
|
474
474
|
function object(shape, params) {
|
|
475
475
|
const def = {
|
|
476
476
|
type: "object",
|
|
477
|
-
shape: shape,
|
|
477
|
+
shape: shape ?? {},
|
|
478
478
|
...index_js_1.util.normalizeParams(params),
|
|
479
479
|
};
|
|
480
480
|
return new exports.ZodMiniObject(def);
|
package/v4/mini/schemas.js
CHANGED
|
@@ -353,7 +353,7 @@ export const ZodMiniObject = /*@__PURE__*/ core.$constructor("ZodMiniObject", (i
|
|
|
353
353
|
export function object(shape, params) {
|
|
354
354
|
const def = {
|
|
355
355
|
type: "object",
|
|
356
|
-
shape: shape,
|
|
356
|
+
shape: shape ?? {},
|
|
357
357
|
...util.normalizeParams(params),
|
|
358
358
|
};
|
|
359
359
|
return new ZodMiniObject(def);
|