UNPKG

@vitruvius-labs/ts-predicate

Version:
14 lines (13 loc) 397 B
/** @internal */ function buildArrayConstraints(constraints) { if (typeof constraints === "function") { return { itemTest: constraints, }; } if (constraints?.minLength !== undefined && constraints.minLength < 1) { throw new RangeError("The minimum length cannot be less than one."); } return constraints; } export { buildArrayConstraints };