express-validator
Advanced tools
Comparing version 6.12.1 to 6.12.2
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "6.12.1", | ||
"version": "6.12.2", | ||
"homepage": "https://express-validator.github.io", | ||
@@ -27,3 +27,5 @@ "license": "MIT", | ||
"!**/*.ts", | ||
"**/*.d.ts" | ||
"**/*.d.ts", | ||
"!website/", | ||
"!docs/" | ||
], | ||
@@ -30,0 +32,0 @@ "scripts": { |
@@ -6,2 +6,3 @@ import { Sanitizers } from '../chain/sanitizers'; | ||
import { Optional } from '../context'; | ||
import { ResultWithContext } from '../chain/context-runner-impl'; | ||
declare type ValidatorSchemaOptions<K extends keyof Validators<any>> = true | { | ||
@@ -47,4 +48,4 @@ options?: Parameters<Validators<any>[K]> | Parameters<Validators<any>[K]>[0]; | ||
export declare function checkSchema(schema: Schema, defaultLocations?: Location[]): ValidationChain[] & { | ||
run: (req: Request) => Promise<unknown[]>; | ||
run: (req: Request) => Promise<ResultWithContext[]>; | ||
}; | ||
export {}; |
@@ -17,2 +17,3 @@ "use strict"; | ||
.forEach(method => { | ||
var _a; | ||
if (typeof chain[method] !== 'function') { | ||
@@ -24,3 +25,3 @@ console.warn(`express-validator: a validator/sanitizer with name ${method} does not exist`); | ||
const methodCfg = config[method]; | ||
let options = methodCfg === true ? [] : methodCfg.options || []; | ||
let options = methodCfg === true ? [] : (_a = methodCfg.options) !== null && _a !== void 0 ? _a : []; | ||
if (options != null && !Array.isArray(options)) { | ||
@@ -27,0 +28,0 @@ options = [options]; |
@@ -7,5 +7,3 @@ "use strict"; | ||
const utils_1 = require("./utils"); | ||
// Assign to a variable so that TS doesn't use its catch all overload, which returns any | ||
const withWithDefaults = { withDefaults }; | ||
exports.validationResult = Object.assign(withDefaults(), withWithDefaults); | ||
exports.validationResult = Object.assign(withDefaults(), { withDefaults }); | ||
class Result { | ||
@@ -12,0 +10,0 @@ constructor(formatter, errors) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95337
76
1