"use strict";

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

const isLiteralValue = require("../is-literal-value");

// NOTE: This validator should typically come last in an `either`, since it will catch various types of inputs (sqlExpression, literal values, etc.) that might need to be interpreted differently in specific contexts.
// FIXME: Rename valueExpression -> value?

module.exports = function (operations) {
	const isValueExpression = require("./is-value-expression")(operations);
	const isObjectType = require("./is-object-type")(operations);

	return either([
		isValueExpression,
		[ isObjectType("anyOfValues") ],
		[ isObjectType("allOfValues") ]
	]);
};
