Closed EvgenyWas closed 3 months ago
Actual behavior: The z.string().base64() validation matches non-base64 strings even when a string is empty.
z.string().base64()
Expected behavior: The z.string().base64() validation matches only valid base64 strings.
Environment:
Reproduction: https://zod-playground.vercel.app?appdata=N4IgzgxgFgpgtgQxALhALwHRgC4CcCWAdgOYAUAlBgEYJgwBsALBQNwgA0IAbggDYCuMMCgDaIAOTiOEwgjgwpncfkTFFEmnSkBdTlxi4w%2BAPaEUIAMwYATFYAcIAL5A
UPD: According to the spec I see the empty string is valid base64. Additionally, I see it's tested with the empty string as well, but I think the rest of values in my repro are still non-valid base64 strings.
Actual behavior: The
z.string().base64()
validation matches non-base64 strings even when a string is empty.Expected behavior: The
z.string().base64()
validation matches only valid base64 strings.Environment:
Reproduction: https://zod-playground.vercel.app?appdata=N4IgzgxgFgpgtgQxALhALwHRgC4CcCWAdgOYAUAlBgEYJgwBsALBQNwgA0IAbggDYCuMMCgDaIAOTiOEwgjgwpncfkTFFEmnSkBdTlxi4w%2BAPaEUIAMwYATFYAcIAL5A
UPD: According to the spec I see the empty string is valid base64. Additionally, I see it's tested with the empty string as well, but I think the rest of values in my repro are still non-valid base64 strings.