Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-validator

Package Overview
Dependencies
Maintainers
3
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-validator - npm Package Compare versions

Comparing version 6.10.1 to 6.11.0

check/index.ts

2

docs/api-check.md

@@ -63,3 +63,3 @@ ---

> _Returns:_ a middleware instance and `{ run: (req) => Promise<void> }`
> _Returns:_ a middleware instance and `{ run: (req) => Promise<Result> }`

@@ -66,0 +66,0 @@ Creates a middleware instance that will ensure at least one of the given chains passes the validation.

@@ -130,2 +130,4 @@ ---

> _Note:_ async functions must return a resolved or rejected `Promise` because `truthy` or `falsy` values won't stop the chain ([#1028](https://github.com/express-validator/express-validator/issues/1028#issuecomment-830561518)).
- A validation chain [created through `check()` or similar functions](api-check.md#check-field-message).

@@ -132,0 +134,0 @@

@@ -10,3 +10,3 @@ {

],
"version": "6.10.1",
"version": "6.11.0",
"homepage": "https://express-validator.github.io",

@@ -13,0 +13,0 @@ "license": "MIT",

@@ -7,3 +7,3 @@ import { Request } from '../base';

import { ContextRunner } from './context-runner';
declare class ResultWithContext extends Result {
export declare class ResultWithContext extends Result {
readonly context: ReadonlyContext;

@@ -20,2 +20,1 @@ constructor(context: ReadonlyContext);

}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextRunnerImpl = void 0;
exports.ContextRunnerImpl = exports.ResultWithContext = void 0;
const _ = require("lodash");

@@ -15,2 +15,3 @@ const base_1 = require("../base");

}
exports.ResultWithContext = ResultWithContext;
class ContextRunnerImpl {

@@ -17,0 +18,0 @@ constructor(builderOrContext, selectFields = select_fields_1.selectFields) {

import { ValidationChain } from '../chain';
import { Middleware, Request } from '../base';
import { Result } from '../validation-result';
export declare type OneOfCustomMessageBuilder = (options: {

@@ -7,6 +8,6 @@ req: Request;

export declare function oneOf(chains: (ValidationChain | ValidationChain[])[], message?: OneOfCustomMessageBuilder): Middleware & {
run: (req: Request) => Promise<void>;
run: (req: Request) => Promise<Result>;
};
export declare function oneOf(chains: (ValidationChain | ValidationChain[])[], message?: any): Middleware & {
run: (req: Request) => Promise<void>;
run: (req: Request) => Promise<Result>;
};

@@ -10,2 +10,3 @@ "use strict";

function oneOf(chains, message) {
let result;
const middleware = async (req, _res, next) => {

@@ -36,3 +37,3 @@ const surrogateContext = new context_builder_1.ContextBuilder().addItem(dummyItem).build();

// Final context running pass to ensure contexts are added and values are modified properly
await new chain_1.ContextRunnerImpl(surrogateContext).run(req);
result = await new chain_1.ContextRunnerImpl(surrogateContext).run(req);
next();

@@ -47,3 +48,3 @@ }

middleware(req, {}, (e) => {
e ? reject(e) : resolve();
e ? reject(e) : resolve(result);
});

@@ -50,0 +51,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc