react-hook-core 0.4.19 → 0.4.20
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.
- package/lib/route.js +2 -2
- package/package.json +2 -2
- package/src/route.ts +2 -2
package/lib/route.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
3
|
-
var
|
|
3
|
+
var query_string_1 = require("query-string")
|
|
4
4
|
var reflect_1 = require("./reflect")
|
|
5
5
|
function goBack(navigate, confirm, resource, o1, o2, keys, version) {
|
|
6
6
|
if (!reflect_1.hasDiff(o1, o2, keys, version)) {
|
|
@@ -23,7 +23,7 @@ function buildParameters(url, model) {
|
|
|
23
23
|
urlSearch = url.substring(i + 1)
|
|
24
24
|
}
|
|
25
25
|
try {
|
|
26
|
-
var parsed = convertToObject(
|
|
26
|
+
var parsed = convertToObject(query_string_1.default.parse(urlSearch), model)
|
|
27
27
|
return parsed
|
|
28
28
|
} catch (error) {
|
|
29
29
|
console.log(error)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-hook-core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.20",
|
|
4
4
|
"description": "react",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/react": "^17.0.41",
|
|
13
13
|
"@types/react-router-dom": "^5.3.3",
|
|
14
|
-
"query-string": "^
|
|
14
|
+
"query-string": "^9.2.2",
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"react-router-dom": "^6.2.2",
|
|
17
17
|
"tslint": "^5.10.0",
|
package/src/route.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import queryString from "query-string"
|
|
2
2
|
import { NavigateFunction } from "react-router-dom"
|
|
3
3
|
import { StringMap } from "./core"
|
|
4
4
|
import { hasDiff } from "./reflect"
|
|
@@ -30,7 +30,7 @@ export function buildParameters<T>(url: string, model?: T): T {
|
|
|
30
30
|
urlSearch = url.substring(i + 1)
|
|
31
31
|
}
|
|
32
32
|
try {
|
|
33
|
-
const parsed: any = convertToObject<T>(
|
|
33
|
+
const parsed: any = convertToObject<T>(queryString.parse(urlSearch), model)
|
|
34
34
|
return parsed
|
|
35
35
|
} catch (error) {
|
|
36
36
|
console.log(error)
|