You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
461 B
JavaScript

"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"
});
};
};