Skip to content

Commit 6dfaa36

Browse files
committed
Remove unneeded query-string package
1 parent 511a8d7 commit 6dfaa36

4 files changed

Lines changed: 6 additions & 74 deletions

File tree

flow-typed/npm/query-string_v7.x.x.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"history": "^4.10.1",
1919
"immer": "^9.0.15",
2020
"prismjs": "^1.29.0",
21-
"query-string": "^7.1.1",
2221
"react": "^17.0.2",
2322
"react-cookie": "^4.1.1",
2423
"react-device-detect": "^1.17.0",

src/SqlEditor.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @flow
2-
import queryString from 'query-string';
32
import * as React from 'react';
43
import Editor from 'react-simple-code-editor';
54
import {highlight, languages} from 'prismjs/components/prism-core';
@@ -42,14 +41,15 @@ class SqlEditor extends React.Component<Props, State> {
4241

4342
componentDidMount() {
4443
// Parse the initial query when we start
45-
const values = queryString.parse(window.location.search);
44+
const values = new URL(window.location.toString()).searchParams;
45+
const query = values.get('query');
4646

47-
if (values.query === undefined) {
47+
if (query) {
48+
this.parseQuery(query, false);
49+
this.setState({query: query});
50+
} else {
4851
this.parseQuery(this.props.defaultText, true);
4952
this.setState({query: this.props.defaultText});
50-
} else {
51-
this.parseQuery(values.query, false);
52-
this.setState({query: values.query});
5353
}
5454
}
5555

yarn.lock

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10152,11 +10152,6 @@ fill-range@^7.0.1:
1015210152
dependencies:
1015310153
to-regex-range "^5.0.1"
1015410154

10155-
filter-obj@^1.1.0:
10156-
version "1.1.0"
10157-
resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b"
10158-
integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==
10159-
1016010155
finalhandler@~1.1.2:
1016110156
version "1.1.2"
1016210157
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d"
@@ -16340,16 +16335,6 @@ query-string@^4.1.0:
1634016335
object-assign "^4.1.0"
1634116336
strict-uri-encode "^1.0.0"
1634216337

16343-
query-string@^7.1.1:
16344-
version "7.1.1"
16345-
resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.1.tgz#754620669db978625a90f635f12617c271a088e1"
16346-
integrity sha512-MplouLRDHBZSG9z7fpuAAcI7aAYjDLhtsiVZsevsfaHWDS2IDdORKbSd1kWUA+V4zyva/HZoSfpwnYMMQDhb0w==
16347-
dependencies:
16348-
decode-uri-component "^0.2.0"
16349-
filter-obj "^1.1.0"
16350-
split-on-first "^1.0.0"
16351-
strict-uri-encode "^2.0.0"
16352-
1635316338
querystring-es3@^0.2.0:
1635416339
version "0.2.1"
1635516340
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"
@@ -18243,11 +18228,6 @@ spdy@^4.0.2:
1824318228
select-hose "^2.0.0"
1824418229
spdy-transport "^3.0.0"
1824518230

18246-
split-on-first@^1.0.0:
18247-
version "1.1.0"
18248-
resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f"
18249-
integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==
18250-
1825118231
split-string@^3.0.1, split-string@^3.0.2:
1825218232
version "3.1.0"
1825318233
resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
@@ -18376,11 +18356,6 @@ strict-uri-encode@^1.0.0:
1837618356
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
1837718357
integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=
1837818358

18379-
strict-uri-encode@^2.0.0:
18380-
version "2.0.0"
18381-
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
18382-
integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==
18383-
1838418359
string-argv@^0.3.1:
1838518360
version "0.3.1"
1838618361
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da"

0 commit comments

Comments
 (0)