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
467 B
JavaScript
20 lines
467 B
JavaScript
"use strict";
|
|
|
|
const defaultTo = require("@validatem/default-to");
|
|
const either = require("@validatem/either");
|
|
const arrayOf = require("@validatem/array-of");
|
|
|
|
const tagAsType = require("../../validators/tag-as-type");
|
|
|
|
module.exports = function (operations) {
|
|
const isField = require("./is-field")(operations);
|
|
|
|
return [
|
|
either([
|
|
[ isField, tagAsType("single") ],
|
|
[ arrayOf(isField), tagAsType("composite") ],
|
|
]),
|
|
defaultTo({ type: "local" }),
|
|
];
|
|
};
|