Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Replace querystring[deprecated] with qs
Browse files Browse the repository at this point in the history
  • Loading branch information
a76yyyy committed May 16, 2023
1 parent b3ff54a commit 9d64ef7
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 66 deletions.
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 20230512,
"version": 20230516,
"Repo": ["https://github.com/a76yyyy/qiandao", "https://github.com/AragonSnow/qiandao", "https://github.com/binux/qiandao"],
"Author&Collaborator": ["binux", "a76yyyy", "AragonSnow", "Mark", "PiDan", "acooler15", "billypon", "liubei121212", "gxitm", "戏如人生", "buzhibujuelb", "powersee", "cxk000"],
"Theme": {
Expand Down
9 changes: 5 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"docs:serve": "vitepress serve docs"
"docs:serve": "vitepress serve docs",
"webpack": "cd static/components & webpack --config webpack.config.js"
},
"repository": {
"type": "git",
Expand All @@ -24,9 +25,9 @@
"homepage": "https://github.com/qiandao-today/qiandao#readme",
"dependencies": {
"curl2har": "^0.0.21",
"querystring": "^0.2.1",
"qs": "^6.11.2",
"tough-cookie": "^4.1.2",
"url": "^0.11.0"
"url": "github:a76yyyy/node-url#master"
},
"engines": {
"node": ">= 0.10.0"
Expand All @@ -51,7 +52,7 @@
"tslib": "^2.5.0",
"typescript": "^4.9.5",
"util": "^0.12.5",
"vite": "^4.3.5",
"vite": "^4.3.6",
"vitepress": "1.0.0-alpha.46",
"vitepress-plugin-search": "1.0.4-alpha.19",
"vue": "^3.3.2",
Expand Down
89 changes: 36 additions & 53 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions web/static/coffee/components/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define (require) ->
querystring_parse: node_querystring.parse
querystring_unparse: node_querystring.stringify
querystring_unparse_with_variables: (obj) ->
query = node_querystring.stringify(obj)
query = node_querystring.stringify(obj, { indices: false })

replace_list = {}
for key, value of obj
Expand All @@ -50,7 +50,7 @@ define (require) ->
replace_list[encodeURIComponent(m[0])] = m[0][..-3] + '|urlencode}}'
else
replace_list[encodeURIComponent(m[0])] = m[0]
if node_querystring.stringify(replace_list)
if node_querystring.stringify(replace_list, { indices: false })
console.log('The replace_list is', replace_list)
for key, value of replace_list
query = query.replace(new RegExp(RegExp.escape(key), 'g'), value)
Expand Down
2 changes: 1 addition & 1 deletion web/static/coffee/har/analysis.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ define (require, exports, module) ->
continue
result = []
try
for key, value of utils.querystring_parse(entry.request.postData.text)
for key, value of utils.querystring_parse_with_variables(entry.request.postData.text)
result.push({ name: key, value: value })
entry.request.postData.params = result
catch error
Expand Down
2 changes: 1 addition & 1 deletion web/static/components/node_components.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/static/components/node_components.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
* @license MIT
*/

/*! https://mths.be/punycode v1.3.2 by @mathias */
/*! https://mths.be/punycode v1.4.1 by @mathias */

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

Expand Down
2 changes: 1 addition & 1 deletion web/static/components/node_components.tpl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
window.node_url = require('url')
window.node_tough = require('tough-cookie')
window.node_querystring = require('querystring')
window.node_querystring = require('qs')
window.node_curl2har = require('curl2har')
4 changes: 3 additions & 1 deletion web/static/components/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/static/har/analysis.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9d64ef7

Please sign in to comment.