Skip to content

Conversation

@GabrielCardoso-0
Copy link

What changed

This PR improves the z.custom() documentation by adding a clearer, more representative
example that demonstrates its intended use with unsupported or external types, such as
class instances.

A note was also added to clarify that z.templateLiteral() should be preferred when
working with template string literal schemas.

Why

The previous documentation could be confusing, as it referenced template string literals
without clearly distinguishing when z.custom() is appropriate versus when a dedicated
schema like z.templateLiteral() should be used.

This change improves clarity without removing or altering any existing API functionality.

Scope

  • Documentation only

Related issue

Closes #5605

@pullfrog
Copy link
Contributor

pullfrog bot commented Jan 4, 2026

Pullfrog  | Review this ➔pullfrog.com

@BrendanC23
Copy link

I don't think that this is the best example for z.custom() because z.instanceof() already exists. See the docs.

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.

[Docs] Maybe new example for z.custom

2 participants