Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type = 'number';
}
switch (format) {
case 'int64':
case 'byte':
case 'binary':
case 'date':
case 'date-time':
return format;
default:
return type;
}
};
const enjoi = Enjoi.defaults({ types, refineType });
const create = function (options = {}) {
const makeValidator = function (parameter, consumes) {
const coerce = coercion(parameter, consumes);
let schema;
if ((parameter.in === 'body' || parameter.in === 'formData') && parameter.schema) {
schema = enjoi.schema(parameter.schema);
}
else {
const template = {
required: parameter.required,
enum: parameter.enum,
type: parameter.type,