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.
18 lines
419 B
JavaScript
18 lines
419 B
JavaScript
"use strict";
|
|
|
|
const wrapError = require("@validatem/wrap-error");
|
|
const ValidationError = require("@validatem/error");
|
|
|
|
module.exports = function (operations) {
|
|
const isIndexType = require("./is-index-type")(operations);
|
|
|
|
return wrapError("Must be a composite index type", [
|
|
isIndexType,
|
|
(node) => {
|
|
if (node.composite !== true) {
|
|
return new ValidationError(`Must be a composite index`);
|
|
}
|
|
}
|
|
]);
|
|
};
|