Const
ArrayLikeSchema.parse([1, 2, 3]); // ✓ Valid (mutable array)
ArrayLikeSchema.parse(['a', 'b'] as const); // ✓ Valid (readonly array)
ArrayLikeSchema.parse([]); // ✓ Valid (empty array)
ArrayLikeSchema.parse([42, 'mixed', true]); // ✓ Valid (mixed types)
ArrayLikeSchema.parse('not an array'); // ✗ Throws validation error
ArrayLikeSchema.parse({}); // ✗ Throws validation error
ArrayLikeSchema.parse(null); // ✗ Throws validation error
A Zod schema that validates array-like structures including mutable and readonly variants.
This schema validates values that behave like arrays, including standard arrays, tuples with rest elements, and their readonly counterparts. It accepts any array-like structure that can hold elements of any type, making it useful for validating collections where the specific array mutability or tuple structure is not critical.