/**
 * Throws an error if it's not an array of x,y objects.
 * Only checks the first element.
 * @param points - list of points.
 * @param options - additional checks.
 */
export function xyObjectCheck(points, options = {}) {
    const { minLength = 0 } = options;
    if (!Array.isArray(points)) {
        throw new Error('points must be an array of {x,y} objects');
    }
    if (points.length > 0 &&
        (typeof points[0].x !== 'number' || typeof points[0].y !== 'number')) {
        throw new Error('points must be an array of {x,y} objects');
    }
    if (minLength && points.length < minLength) {
        throw new Error(`points must have a length of at least ${minLength}`);
    }
}
//# sourceMappingURL=xyObjectCheck.js.map