"use strict";

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

module.exports = function (operations) {
	const isCondition = require("./is-condition")(operations);

	return wrapError("Must be a list of conditions and/or values", [
		// FIXME: Do we actually want `required` here? We might want to eventually accept `null` as an automatically-wrapped literal value, or do we want a marker object for that instead?
		arrayOf([ required, isCondition ])
	], { preserveOriginalErrors: true });
};
