Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@colinhacks
Copy link
Owner

Summary

  • introduce safeExtend utility in core
  • expose safeExtend method on ZodObject
  • add safeExtend for ZodMini
  • test safeExtend in both Classic and Mini variants

Testing

  • npx biome check packages/zod/src/v4/mini/schemas.ts
  • npx biome check packages/zod/src/v4/classic/schemas.ts
  • npx biome check packages/zod/src/v4/mini/tests/object.test.ts
  • npx biome check packages/zod/src/v4/classic/tests/object.test.ts
  • npx biome check packages/zod/src/v4/core/util.ts
  • npx vitest run

https://chatgpt.com/codex/tasks/task_e_686efeb26058832f824fe50333b23f9e

@colinhacks colinhacks changed the base branch from main to dev July 29, 2025 02:37
@colinhacks colinhacks merged commit 4f3640d into dev Jul 30, 2025
4 checks passed
@colinhacks colinhacks deleted the codex/implement-safeextend-method-in-zod branch July 30, 2025 07:12
colinhacks added a commit that referenced this pull request Aug 6, 2025
@colinhacks colinhacks mentioned this pull request Aug 21, 2025
colinhacks added a commit that referenced this pull request Aug 23, 2025
colinhacks added a commit that referenced this pull request Aug 23, 2025
* Add continuability tests

* Update docs for custom string formats (#4868)

* docs: add stringFormat examples

* Improve

* Improve regex

* Improve regex

* Add console output guard (#4869)

* test: fail on console output

* Fmt

* feat(object): add safeExtend (#4865)

* `z.hash()` (#5049)

* Implement z.hash()

* Implement tests

* Document z.hash

* Update packages/zod/src/v4/core/regexes.ts

Co-authored-by: Copilot <[email protected]>

* Throw on unrecognized

---------

Co-authored-by: Copilot <[email protected]>

* Drop JIT in Zod Mini `z.object()` (reduces bundle size by 20%) (#5051)

* WIP

* WIP

* No comments

* feat: add openapi target to json schema (#5052)

* Implement `z.codec` (#5113)

* WIP

* WIP

* WIP

* Fix pipe

* Add mini codec tests

* Fix test

* WIP

* Add codecs graphic

* Add reverse tests for pipe

* WIP

* More fixes

* Remove logs

* WIP

* Make `z.function()` extend $ZodType (#5121)

* WIP

* Add back function schemas

* Drop unneeded import

* Implement z.hex() (#5122)

* Document codec examples (#5123)

* Document codec examples

* Avoid zodtypeany

* Tweaks

* Improve docs

* Improve docs

* Tweak

* Tweak

* Update json codec

* Update disc union docs. Closes #5108

* Add .options to ZodMiniEnum. Closes #5116

* Implement two-phase parsing for codecs

* Add mutating test

* Improve when docs

* Support the Max UUID in z.uuid(). Closes #5127

* Make z.hash format properly inferred

* Update snapshots with new uuid regex

* Add hex,hash to docs.

* Throw on .extend() when refinements are present. Document safeExtend()

* Update safeExtend docs

* Update meta docs

* Update packages/docs/content/api.mdx

Co-authored-by: Sam Chung <[email protected]>

* Add section for customizing z.coerce inputs

* Tweak

* Docs tweak

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Sam Chung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants