Scott Trinh

Results 319 comments of Scott Trinh

Yeah, I think maybe that's the crux of the issue: the two types describes valid inputs and valid outputs. It doesn't describe the domain of expected inputs that might be...

> allows null to get through Yeah, and that's why I said you'll have to map `null` to _something_ in the `number` domain since you're saying the input domain is...

@roblabat Looking good! I'll try to take some time in the next day or two to look a little more deeply at the implementation here, but first quick pass looks...

Hmmm.. Nothing comes to mind already. One tricky thing here is that you could have a schema like `z.object({}).passthrough()` which should make the `keyof` type `never`, which might be a...

Do you have `strict: true` in your `tsconfig.json`? I cannot reproduce the issue in the TypeScript playground: [TypeScript Playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgLzgXzgMyhEcBEyEAJvgNwBQFAxhAHYDO8ArgwKZQBacAvCgHTFgDalFDA6AQxhtiAVTrB6ACnwwAnmDb4ANHADaFOAIgAjAFZtqMZUg1aAXAIA2wGVEnPVk4iAn4ASj1gYidkfiYxOgBzZQD0IKMTCysbO002MP5Xd09VVg5A4NCBSIlYoLhTYFgAC2JJdSyymLiEnQoAXQDKCkxmOmslOjgwSSh2AFk2ZQKoJwGAazoIAHc6eIQk2kZ4MYnZOXYoXjg5zgjJTDYABXH2WeOepOBMOGUAQn32eWOI5mo1DYDAYmySxh2DAgzjY-A4OCgym+hz+8Ogz2MxigbBgzCgIzozGczkoxjQVCxOLxI2Rvw4gmkkko5KAA) ![Screen Shot 2022-06-06 at 11 17 24 AM](https://user-images.githubusercontent.com/1682194/172190888-b8a51d8e-dad0-42d9-8563-0339d8e711ef.png)

@ytsruh `SafeParseReturnType` is a discriminated union, so you have to narrow the type before accessing the properties of the result object. A few of the examples above show how it's...

> I think the return values of the safeParse and its types needs to be make more consistent. I think both cases must have the same fields, just with different...

Since no one has demonstrated any bug or incorrect results here, I'm going to close this issue so that it doesn't become a dumping ground for similar issues or related...

No noticeable changes in the benchmarks for the existing functionality, so I'd say this is ready to merge! Thanks @SrBrahma for the contribution.

I like the idea of naming them after what they do rather than describing the symbol, even though the symbol names are shorter. One interesting thought is that all three...