Skip to content

Commit

Permalink
fix: address new qs typings in express types
Browse files Browse the repository at this point in the history
  • Loading branch information
evanshortiss committed Jul 15, 2020
1 parent 9a18c94 commit 3df3d46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion express-joi-validation.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -43,7 +44,7 @@ export type ValidatedRequestSchema = Record<ContainerTypes, any>
export interface ValidatedRequest<T extends ValidatedRequestSchema>
extends express.Request {
body: T[ContainerTypes.Body]
query: T[ContainerTypes.Query]
query: T[ContainerTypes.Query] & ParsedQs
headers: T[ContainerTypes.Headers]
params: T[ContainerTypes.Params]
}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down

0 comments on commit 3df3d46

Please sign in to comment.