express-ext 0.5.9 → 0.5.10

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/view.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-ext",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "express-ext",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/view.ts CHANGED
@@ -21,7 +21,7 @@ export function buildId<T>(req: Request, attrs?: Attribute[]): T | undefined {
21
21
  let id = req.params["id"] as string
22
22
  const n = attrs[0].name
23
23
  if ((!id || id.length === 0) && n && n.length > 0) {
24
- id = req.params[n]
24
+ id = req.params[n] as string
25
25
  }
26
26
  if (id && id.length > 0) {
27
27
  if (attrs[0].type === "integer" || attrs[0].type === "number") {
@@ -47,7 +47,7 @@ export function buildId<T>(req: Request, attrs?: Attribute[]): T | undefined {
47
47
  if (isNaN(v as any)) {
48
48
  return undefined
49
49
  }
50
- ids[attr.name] = parseFloat(v)
50
+ ids[attr.name] = parseFloat(v as string)
51
51
  } else {
52
52
  ids[attr.name] = v
53
53
  }