@interop/did-web-resolver 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ var ed25519Context = require('ed25519-signature-2020-context');
8
8
  var x25519Context = require('x25519-key-agreement-2020-context');
9
9
  var didContext = require('did-context');
10
10
  var bnid = require('@digitalcredentials/bnid');
11
+ var whatwgUrl = require('whatwg-url');
11
12
 
12
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
14
 
@@ -54,7 +55,7 @@ function didFromUrl ({ url } = {}) {
54
55
 
55
56
  let parsedUrl;
56
57
  try {
57
- parsedUrl = new URL(url);
58
+ parsedUrl = new whatwgUrl.URL(url);
58
59
  } catch (error) {
59
60
  throw new TypeError(`Invalid url: "${url}".`)
60
61
  }
@@ -88,7 +89,7 @@ function urlFromDid ({ did } = {}) {
88
89
  try {
89
90
  // URI-decode the url (in case it contained a port number,
90
91
  // for example, `did:web:localhost%3A8080`
91
- parsedUrl = new URL('https://' + decodeURIComponent(urlNoProtocol));
92
+ parsedUrl = new whatwgUrl.URL('https://' + decodeURIComponent(urlNoProtocol));
92
93
  } catch (error) {
93
94
  throw new TypeError(`Cannot construct url from did: "${did}".`)
94
95
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@interop/did-web-resolver",
3
3
  "description": "A did:web method Decentralized Identifier (DID) resolver for the did-io library.",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "author": {
6
6
  "name": "Dmitri Zagidulin",
7
7
  "url": "https://github.com/dmitrizagidulin/"
@@ -48,6 +48,7 @@
48
48
  "@digitalcredentials/http-client": "^1.2.2",
49
49
  "did-context": "^3.1.1",
50
50
  "ed25519-signature-2020-context": "^1.1.0",
51
+ "whatwg-url": "^11.0.0",
51
52
  "x25519-key-agreement-2020-context": "^1.0.0"
52
53
  },
53
54
  "devDependencies": {
@@ -4,6 +4,7 @@ import ed25519Context from 'ed25519-signature-2020-context'
4
4
  import x25519Context from 'x25519-key-agreement-2020-context'
5
5
  import didContext from 'did-context'
6
6
  import { decodeSecretKeySeed } from '@digitalcredentials/bnid'
7
+ import { URL } from 'whatwg-url'
7
8
 
8
9
  const { VERIFICATION_RELATIONSHIPS } = didIo
9
10