Comments (1)
I think my issue is the same (or very related). Chaining .transform
with .superRefine
skips transform when the input is invalid.
this here:
const uuidSchema = z
.string()
.uuid()
.transform((value) => {
console.log('transform called')
return value
})
.superRefine(() => {
console.log('super refine called')
})
uuidSchema.parse('invalid')
logs super refine called
but not(!) transform called
. Is this a bug or by design? How could I check if transform did successfully in super refine?
from zod.
Related Issues (20)
- ipv6: case insensitive comparison
- String is hex
- Feature: support multiple parameters in `.startsWith()` HOT 3
- Proper inference of a string to typeof keyof Object
- Misleading Error: "Property 'infer' Does Not Exist" When Using const Instead of type in Zod HOT 4
- Creating a large schema from a subset HOT 1
- File zod/index.d.ts is not a module.
- The above code how to verify whether newPwd and confirmPwd are consistent, and can get a custom message when the verification fails, just like two passwords are inconsistent; Just like if this check doesn't pass, it gets it in errors.message HOT 1
- z.infer<> fails to infer nested union type. HOT 1
- Using generic schemas from generic functions makes enum fields optional
- Email validation fails on "=" equals sign HOT 1
- variadic rest in the tuple with min & max capability HOT 1
- Inferred type imported from library has all fields as optional HOT 4
- Add support for `base64url` strings
- `z.ref`
- Improve regex DX by adding babel-plugin-transform-regex as dev dependency
- `z.lazy` docs
- Workarounds for TS 7056? HOT 2
- Problems with .superRefine using discriminated unions HOT 2
- Question: is it correct to assume that ZodIssue[] will always equal NonEmptyArray<ZodIssue> if the result of safeParse(schema).succes is false?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zod.