express-ext 0.5.10 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/http.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-ext",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "express-ext",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/http.ts CHANGED
@@ -245,11 +245,11 @@ export function getRequiredDate(req: Request, res: Response, name: string): Date
245
245
  return date
246
246
  }
247
247
  export function getDate(req: Request, name: string, d?: Date): Date | undefined {
248
- const v = req.params[name]
248
+ const v = req.params[name] as string
249
249
  if (!v || v.length === 0) {
250
250
  return d
251
251
  }
252
- const date = new Date(v)
252
+ const date = new Date(v as string)
253
253
  if (date.toString() === "Invalid Date") {
254
254
  return d
255
255
  }