From 3df3d462dade0efaabf300240f9928f26a415d00 Mon Sep 17 00:00:00 2001 From: Evan Shortiss Date: Wed, 15 Jul 2020 17:34:15 +0100 Subject: [PATCH] fix: address new qs typings in express types --- express-joi-validation.d.ts | 3 ++- package.json | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/express-joi-validation.d.ts b/express-joi-validation.d.ts index 33428ce..8231968 100644 --- a/express-joi-validation.d.ts +++ b/express-joi-validation.d.ts @@ -1,6 +1,7 @@ import * as Joi from '@hapi/joi' import * as express from 'express' import { IncomingHttpHeaders } from 'http' +import { ParsedQs } from 'qs' /** * Creates an instance of this module that can be used to generate middleware @@ -43,7 +44,7 @@ export type ValidatedRequestSchema = Record export interface ValidatedRequest extends express.Request { body: T[ContainerTypes.Body] - query: T[ContainerTypes.Query] + query: T[ContainerTypes.Query] & ParsedQs headers: T[ContainerTypes.Headers] params: T[ContainerTypes.Params] } diff --git a/package.json b/package.json index 336034f..377dc08 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "@types/express-formidable": "~1.0.4", "@types/hapi__joi": "~16.0.3", "@types/node": "~10.14.18", + "@types/qs": "~6.9.3", "body-parser": "~1.18.3", "chai": "~3.5.0", "clear-require": "~2.0.0", @@ -50,6 +51,7 @@ "nyc": "~14.1.1", "prettier": "~1.14.3", "proxyquire": "~1.7.11", + "qs": "~6.9.4", "sinon": "~1.17.7", "supertest": "~3.0.0", "typescript": "~3.5.2"