Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/note.picotech.app/public_html/node_modules/express-validator/lib/middlewares/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.query = exports.param = exports.header = exports.cookie = exports.body = exports.check = void 0;
exports.buildCheckFunction = buildCheckFunction;
const check_1 = require("./check");
/**
* Creates a variant of `check()` that checks the given request locations.
*
* @example
* const checkBodyAndQuery = buildCheckFunction(['body', 'query']);
*/
function buildCheckFunction(locations) {
return (fields, message) => (0, check_1.check)(fields, locations, message);
}
/**
* Creates a middleware/validation chain for one or more fields that may be located in
* any of the following:
*
* - `req.body`
* - `req.cookies`
* - `req.headers`
* - `req.params`
* - `req.query`
*
* @param fields a string or array of field names to validate/sanitize
* @param message an error message to use when failed validations don't specify a custom message.
* Defaults to `Invalid Value`.
*/
exports.check = buildCheckFunction(['body', 'cookies', 'headers', 'params', 'query']);
/**
* Same as {@link check()}, but only validates `req.body`.
*/
exports.body = buildCheckFunction(['body']);
/**
* Same as {@link check()}, but only validates `req.cookies`.
*/
exports.cookie = buildCheckFunction(['cookies']);
/**
* Same as {@link check()}, but only validates `req.headers`.
*/
exports.header = buildCheckFunction(['headers']);
/**
* Same as {@link check()}, but only validates `req.params`.
*/
exports.param = buildCheckFunction(['params']);
/**
* Same as {@link check()}, but only validates `req.query`.
*/
exports.query = buildCheckFunction(['query']);
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0106 ]-- |