Skip to content

fix: replace .default with .prefault#5776

Merged
colinhacks merged 1 commit into
colinhacks:mainfrom
alanskovrlj:main
Apr 28, 2026
Merged

fix: replace .default with .prefault#5776
colinhacks merged 1 commit into
colinhacks:mainfrom
alanskovrlj:main

Conversation

@alanskovrlj

Copy link
Copy Markdown
Contributor

The test intended to verify the behavior of .prefault(), but it was using .default() instead.

This PR updates the test to use .prefault() so it correctly tests the intended functionality.

@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

@alanskovrlj is attempting to deploy a commit to the colinhacks Team on Vercel.

A member of the Team first needs to authorize it.

@colinhacks

Copy link
Copy Markdown
Owner

@pullfrog review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no issues found.

The change is correct: the test is named "object schema with prefault should return shallow clone" and lives in prefault.test.ts, so it should be calling .prefault() rather than .default(). The shallow clone behavior being tested (result1 !== result2 && deepEqual(result1, result2)) works identically for both methods (the cloning happens in the defaultValue getter shared by both), but .prefault() is the right one to exercise here. There's already an equivalent .default() test in default.test.ts:315.

Task list (3/3 completed)
  • Checkout PR and read diff
  • Investigate the claimed bug — verify whether .default() vs .prefault() is correct in the test
  • Submit review

Pullfrog  | View workflow run | Using Claude Opus𝕏

@colinhacks colinhacks merged commit b59b9b1 into colinhacks:main Apr 28, 2026
7 of 8 checks passed
@colinhacks

Copy link
Copy Markdown
Owner

Good catch — the test in prefault.test.ts was clearly meant to exercise .prefault(). Merged, thanks 👍

Note: this comment was produced by an AI coding assistant.

@colinhacks

Copy link
Copy Markdown
Owner

Landed in Zod 4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants