ConstArrayLikeSchema.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
import { createAssertion, use } from 'bupkis';
import { ArrayLikeSchema } from 'bupkis/schema';
const argsAssertion = createAssertion(
  [ArrayLikeSchema, 'to be a non-array arraylike object'],
  ArrayLikeSchema.refine((subject) => !Array.isArray(subject)),
);
const { expect } = use([argsAssertion]);
expect(
  (function () {
    return arguments;
  })(),
  'to be a non-array arraylike object',
);
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.