"use strict";

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

const isTableName = require("../validators/is-table-name");

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

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

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