Skip to content

Commit

Permalink
Remove dep on querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer committed Jul 20, 2021
1 parent ed477f3 commit 2d864d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@
"memoize-one": "^5.2.1",
"monaco-editor": "0.23.0",
"neo4j-driver": "^4.3.1",
"querystring": "^0.2.1",
"react": "^16.9.0",
"react-dnd": "^11.1.3",
"react-dnd-html5-backend": "^11.1.3",
Expand Down
24 changes: 7 additions & 17 deletions src/shared/modules/auth/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,16 @@ import {
mandatoryKeysForSSOProviders,
searchParamsToSaveForAfterAuthRedirect
} from './settings'
import { parse as parseQueryString } from 'querystring'

export const getInitialisationParameters = (
urlSearchParams = window.location.search,
urlHashParams = window.location.hash
urlSearchParams = window.location.search
) => {
let initParams = {}
try {
initParams = {
...parseQueryString(urlSearchParams.replace(/^\?/, '')),
...parseQueryString(urlHashParams.replace(/^#/, ''))
}
Object.keys(initParams).forEach(key => {
if (initParams[key].trim().length === 0) {
initParams[key] = null
}
})
} catch (exc) {
console.warn('Exception occured while parsing Browser URL parameters', exc)
}
const initParams = {}

new URLSearchParams(urlSearchParams).forEach((value, key) => {
initParams[key] = value
})

return initParams
}

Expand Down
1 change: 0 additions & 1 deletion src/shared/modules/discovery/discoveryDuck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export const discoveryOnStartupEpic = (some$: any, store: any) => {
if (!passedURL || !passedURL.length) return action
action.forceURL = decodeURIComponent(passedURL[0])
action.requestedUseDb = passedDb && passedDb[0]

return action
})
.merge(some$.ofType(USER_CLEAR))
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10880,11 +10880,6 @@ querystring@0.2.0, querystring@^0.2.0:
resolved "https://neo.jfrog.io/neo/api/npm/npm/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=

querystring@^0.2.1:
version "0.2.1"
resolved "https://neo.jfrog.io/neo/api/npm/npm/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd"
integrity sha1-QNd2FbsJ0WkCqFw+OKqLXtdhwt0=

querystringify@^2.1.1:
version "2.2.0"
resolved "https://neo.jfrog.io/neo/api/npm/npm/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
Expand Down

0 comments on commit 2d864d0

Please sign in to comment.