zod 4.2.0-canary.20250911T051312 → 4.2.0-canary.20250911T051520
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
CHANGED
|
@@ -324,6 +324,14 @@ test("defaulted object schema returns shallow clone", () => {
|
|
|
324
324
|
expect(result1).toEqual(result2);
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
+
test("defaulted array schema returns shallow clone", () => {
|
|
328
|
+
const schema = z.array(z.string()).default(["x"]);
|
|
329
|
+
const result1 = schema.parse(undefined);
|
|
330
|
+
const result2 = schema.parse(undefined);
|
|
331
|
+
expect(result1).not.toBe(result2);
|
|
332
|
+
expect(result1).toEqual(result2);
|
|
333
|
+
});
|
|
334
|
+
|
|
327
335
|
test("direction-aware defaults", () => {
|
|
328
336
|
const schema = z.string().default("hello");
|
|
329
337
|
|
package/src/v4/core/util.ts
CHANGED
package/v4/core/util.cjs
CHANGED
package/v4/core/util.js
CHANGED