"use strict";

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

const makeIndexObject = require("./_make-index-object");

module.exports = function (operations) {
	const isIndexFields = require("../../validators/operations/is-index-fields")(operations);

	return function primaryKey(_fields) {
		let [ fields ] = validateArguments(arguments, {
			fields: isIndexFields
		});

		return makeIndexObject(fields, {
			indexType: "primaryKey"
		});
	};
};
