"use strict";

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

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

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

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

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