We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bd2d05a + 5351337 commit f6c47d7Copy full SHA for f6c47d7
libs/remix-lib/src/query-params.ts
@@ -11,11 +11,21 @@ export class QueryParams {
11
let queryString = '#'
12
const updatedKeys = Object.keys(currentParams)
13
for (const y in updatedKeys) {
14
- queryString += updatedKeys[y] + '=' + currentParams[updatedKeys[y]] + '&'
+ if (currentParams[updatedKeys[y]]) {
15
+ queryString += updatedKeys[y] + '=' + currentParams[updatedKeys[y]] + '&'
16
+ } else {
17
+ queryString += updatedKeys[y] + '&'
18
+ }
19
+
20
}
21
window.location.hash = queryString.slice(0, -1)
22
23
24
+ exists (key) {
25
+ const params = this.get()
26
+ return Object.keys(params).includes(key)
27
28
29
get () {
30
const qs = window.location.hash.substr(1)
31
0 commit comments