@spoosh/plugin-qs 0.2.2 → 0.2.4
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/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ function qsPlugin(config = {}) {
|
|
|
46
46
|
name: "spoosh:qs",
|
|
47
47
|
operations: ["read", "write", "infiniteRead"],
|
|
48
48
|
middleware: async (context, next) => {
|
|
49
|
-
const query = context.
|
|
49
|
+
const query = context.request.query;
|
|
50
50
|
if (!query || Object.keys(query).length === 0) {
|
|
51
51
|
return next();
|
|
52
52
|
}
|
|
@@ -58,8 +58,8 @@ function qsPlugin(config = {}) {
|
|
|
58
58
|
encode: false
|
|
59
59
|
});
|
|
60
60
|
const flatQuery = import_qs.default.parse(stringified, { depth: 0 });
|
|
61
|
-
context.
|
|
62
|
-
...context.
|
|
61
|
+
context.request = {
|
|
62
|
+
...context.request,
|
|
63
63
|
query: flatQuery
|
|
64
64
|
};
|
|
65
65
|
return next();
|
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ function qsPlugin(config = {}) {
|
|
|
10
10
|
name: "spoosh:qs",
|
|
11
11
|
operations: ["read", "write", "infiniteRead"],
|
|
12
12
|
middleware: async (context, next) => {
|
|
13
|
-
const query = context.
|
|
13
|
+
const query = context.request.query;
|
|
14
14
|
if (!query || Object.keys(query).length === 0) {
|
|
15
15
|
return next();
|
|
16
16
|
}
|
|
@@ -22,8 +22,8 @@ function qsPlugin(config = {}) {
|
|
|
22
22
|
encode: false
|
|
23
23
|
});
|
|
24
24
|
const flatQuery = qs.parse(stringified, { depth: 0 });
|
|
25
|
-
context.
|
|
26
|
-
...context.
|
|
25
|
+
context.request = {
|
|
26
|
+
...context.request,
|
|
27
27
|
query: flatQuery
|
|
28
28
|
};
|
|
29
29
|
return next();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-qs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Query string serialization plugin for Spoosh with nested object support",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"qs": "^6.13.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@spoosh/core": ">=0.
|
|
40
|
+
"@spoosh/core": ">=0.11.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/qs": "^6.9.17",
|
|
44
|
-
"@spoosh/core": "0.
|
|
45
|
-
"@spoosh/test-utils": "0.1.
|
|
44
|
+
"@spoosh/core": "0.11.1",
|
|
45
|
+
"@spoosh/test-utils": "0.1.6"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"dev": "tsup --watch",
|