Skip to content

Commit

Permalink
docs(guide/manually-running): typescript example should use `ContextR…
Browse files Browse the repository at this point in the history
…unner` (#1261)
  • Loading branch information
dillonstreator committed Nov 19, 2023
1 parent 28a8d5f commit 6069db8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/guides/manually-running.md
Expand Up @@ -24,7 +24,7 @@ Check the examples below to understand how this method can help you:

```js
const express = require('express');
const { validationResult, ValidationChain } = require('express-validator');
const { validationResult } = require('express-validator');
// can be reused by many routes

// sequential processing, stops running validations chain if the previous one fails.
Expand Down Expand Up @@ -58,11 +58,11 @@ app.post('/signup', validate([

```typescript
import express from 'express';
import { body, validationResult, ValidationChain } from 'express-validator';
import { body, validationResult, ContextRunner } from 'express-validator';
// can be reused by many routes

// sequential processing, stops running validations chain if the previous one fails.
const validate = (validations: ValidationChain[]) => {
const validate = (validations: ContextRunner[]) => {
return async (req: express.Request, res: express.Response, next: express.NextFunction) => {
for (const validation of validations) {
const result = await validation.run(req);
Expand Down
Expand Up @@ -24,7 +24,7 @@ Check the examples below to understand how this method can help you:

```js
const express = require('express');
const { validationResult, ValidationChain } = require('express-validator');
const { validationResult } = require('express-validator');
// can be reused by many routes

// sequential processing, stops running validations chain if the previous one fails.
Expand Down Expand Up @@ -58,11 +58,11 @@ app.post('/signup', validate([

```typescript
import express from 'express';
import { body, validationResult, ValidationChain } from 'express-validator';
import { body, validationResult, ContextRunner } from 'express-validator';
// can be reused by many routes

// sequential processing, stops running validations chain if the previous one fails.
const validate = (validations: ValidationChain[]) => {
const validate = (validations: ContextRunner[]) => {
return async (req: express.Request, res: express.Response, next: express.NextFunction) => {
for (let validation of validations) {
const result = await validation.run(req);
Expand Down

0 comments on commit 6069db8

Please sign in to comment.