"use strict";

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

const isCollectionName = require("../validators/is-collection-name");

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

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

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