Skip to content

Commit

Permalink
fix(deps): remove querystring in favor of UrlSearchParams
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Jan 13, 2022
1 parent f6be588 commit cd5e596
Show file tree
Hide file tree
Showing 4 changed files with 1,585 additions and 2,739 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
"@ethersproject/contracts": "^5.5.0",
"@ethersproject/providers": "^5.5.0",
"@ethersproject/transactions": "^5.5.0",
"did-resolver": "^3.1.3",
"ethr-did-registry": "^0.0.3",
"querystring": "^0.2.1"
"did-resolver": "^3.1.5",
"ethr-did-registry": "^0.0.3"
}
}
2 changes: 1 addition & 1 deletion src/__tests__/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ describe('ethrResolver', () => {
],
authentication: [`${keyAgrDid}#controller`],
assertionMethod: [`${keyAgrDid}#controller`, `${keyAgrDid}#delegate-1`],
keyAgreement: [`${keyAgrDid}#delegate-1`]
keyAgreement: [`${keyAgrDid}#delegate-1`],
})
})
})
Expand Down
5 changes: 2 additions & 3 deletions src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
strip0x,
} from './helpers'
import { logDecoder } from './logParser'
import * as qs from 'querystring'

export function getResolver(options: ConfigurationOptions): Record<string, DIDResolver> {
return new EthrDidResolver(options).build()
Expand Down Expand Up @@ -322,8 +321,8 @@ export class EthrDidResolver {
const networkId = !fullId[1] ? 'mainnet' : fullId[1].slice(0, -1)
let blockTag: string | number = options.blockTag || 'latest'
if (typeof parsed.query === 'string') {
const qParams = qs.decode(parsed.query)
blockTag = typeof qParams['versionId'] === 'string' ? qParams['versionId'] : blockTag
const qParams = new URLSearchParams(parsed.query)
blockTag = qParams.get('versionId') ?? blockTag
try {
blockTag = Number.parseInt(<string>blockTag)
} catch (e) {
Expand Down
Loading

0 comments on commit cd5e596

Please sign in to comment.