"use strict";

const wrapError = require("@validatem/wrap-error");
const required = require("@validatem/required");
const arrayOf = require("@validatem/array-of");

module.exports = function (operations) {
	const isWhereObject = require("./is-where-object")(operations);

	return wrapError("Must be a list of WHERE condition objects", [
		arrayOf([ required, isWhereObject ])
	], { preserveOriginalErrors: true });
};
