Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case 'request':
return request;
case 'query':
return ValidateParam(args[key], request.query[name], models, name, fieldErrors);
case 'path':
return ValidateParam(args[key], request.params[name], models, name, fieldErrors);
case 'header':
return ValidateParam(args[key], request.header(name), models, name, fieldErrors);
case 'body':
return ValidateParam(args[key], request.body, models, name, fieldErrors, name + '.');
case 'body-prop':
return ValidateParam(args[key], request.body[name], models, name, fieldErrors, 'body.');
}
});
if (Object.keys(fieldErrors).length > 0) {
throw new ValidateError(fieldErrors, '');
}
return values;
}
}
case 'request':
return request;
case 'query':
return ValidateParam(args[key], request.query[name], models, name, fieldErrors);
case 'path':
return ValidateParam(args[key], request.params[name], models, name, fieldErrors);
case 'header':
return ValidateParam(args[key], request.header(name), models, name, fieldErrors);
case 'body':
return ValidateParam(args[key], request.body, models, name, fieldErrors, name + '.');
case 'body-prop':
return ValidateParam(args[key], request.body[name], models, name, fieldErrors, 'body.');
}
});
if (Object.keys(fieldErrors).length > 0) {
throw new ValidateError(fieldErrors, '');
}
return values;
}
}
case 'request':
return request;
case 'query':
return validationService.ValidateParam(args[key], request.query[name], name, fieldErrors);
case 'path':
return validationService.ValidateParam(args[key], request.params[name], name, fieldErrors);
case 'header':
return validationService.ValidateParam(args[key], request.header(name), name, fieldErrors);
case 'body':
return validationService.ValidateParam(args[key], request.body, name, fieldErrors, name + '.');
case 'body-prop':
return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, 'body.');
}
});
if (Object.keys(fieldErrors).length > 0) {
throw new ValidateError(fieldErrors, '');
}
return values;
}
}