KC's Workspace
    Preparing search index...

    Variable zStringArrayConst

    zStringArray: z.ZodPreprocess<z.ZodArray<z.ZodString>> = ...

    Zod schema for parsing comma/newline-separated string to array of strings. Supports both comma-separated and newline-separated values. Use .optional() for optional fields.

    const schema = z.object({ tags: zStringArray });
    schema.parse({ tags: "a,b,c" }); // { tags: ["a", "b", "c"] }
    schema.parse({ tags: "a\nb\nc" }); // { tags: ["a", "b", "c"] }