"use strict";

const wrapError = require("@validatem/wrap-error");
const either = require("@validatem/either");
const isString = require("@validatem/is-string");

module.exports = function (operations) {
	const isColumnObject = require("./is-column-object")(operations);
	const wrapPossiblyForeignColumnName = require("./wrap-possibly-foreign-column-name")(operations);
	
	return wrapError("Must be a column name or object", either([
		[ isColumnObject ],
		[ isString, wrapPossiblyForeignColumnName ]
	]));
};
