Closed dearlordylord closed 1 week ago
It's a minor devex issue but I believe can be easily avoided; default expectation from libs is that the "errors" ("issues" in this case) field is not present after it's clear that the discriminated union is not a error-ish.
Maybe just removing https://github.com/fabian-hiller/valibot/blob/2d2e553b1ad18e0e68bcfb2870dd138c8987982d/library/src/methods/safeParse/types.ts#L33 solves it?
(thanks for the lib, it's so far really pleasant API to use)
This is intended. Our SafeParseResult type basically represents exactly the data that is returned and .issues is always present as you can see here.
SafeParseResult
.issues
It's a minor devex issue but I believe can be easily avoided; default expectation from libs is that the "errors" ("issues" in this case) field is not present after it's clear that the discriminated union is not a error-ish.
Maybe just removing https://github.com/fabian-hiller/valibot/blob/2d2e553b1ad18e0e68bcfb2870dd138c8987982d/library/src/methods/safeParse/types.ts#L33 solves it?
(thanks for the lib, it's so far really pleasant API to use)