#Zod Why

1 messages · Page 1 of 1 (latest)

umbral sageBOT
#
drwarpman#0

Preview:```ts
import {z} from "zod"

const nonEmptyString = z.string().min(1)

const foo = z.object({
bar: z.union([
nonEmptyString,
nonEmptyString.array(),
]),
})

export type Foo = z.infer<typeof foo>
// ^?```

late quest
#

Foo.bar = (string | string[]) & (string | string[] | undefined)
Expected: string | string[]

versed wren
#

seems that the two are equal

fresh kiln