UNPKG

tree-house

Version:

NodeJS utilities and handy helpers extending ExpressJS functionalities

16 lines (15 loc) 456 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSchema = void 0; const expressValidation = require("express-validation"); function validateSchema(schema, options = {}) { return function (req, res, next) { try { expressValidation.validate(schema, options)(req, res, next); } catch (err) { throw err; } }; } exports.validateSchema = validateSchema;