KC's Workspace
    Preparing search index...

    Variable zNumberArrayConst

    zNumberArray: z.ZodPreprocess<z.ZodArray<z.ZodNumber>> = ...

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

    const schema = z.object({ ids: zNumberArray });
    schema.parse({ ids: "1,2,3" }); // { ids: [1, 2, 3] }
    schema.parse({ ids: "1\n2\n3" }); // { ids: [1, 2, 3] }