"use strict";

const { validateArguments } = require("@validatem/core");
const required = require("@validatem/required");

const isLocalColumnName = require("../validators/is-local-column-string");

const node = require("../ast-node");

module.exports = function column(_operations) {
	return function (_name) {
		let [ name ] = validateArguments(arguments, {
			name: [ required, isLocalColumnName ]
		});

		return node({ type: "columnName", name });
	};
};
