Skip to content

Commit

Permalink
Remove use of 'URL.protocol' (not implemented in React Native).
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrizagidulin committed Jul 6, 2022
1 parent 65b6404 commit 218cc6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# @digitalcredentials/vc ChangeLog

## 4.1.1 - 2022-07-06

### Fixed
- Remove use of `URL.protocol` (not implemented in React Native).

## 4.1.0 - 2022-07-06

### Added
Expand Down
7 changes: 1 addition & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,16 +681,11 @@ function _checkCredential({credential, log = [], now = new Date()}) {
}

function _validateUriId({id, propertyName}) {
let parsed;
try {
parsed = new URL(id);
new URL(id);
} catch(e) {
const error = new TypeError(`"${propertyName}" must be a URI: "${id}".`);
error.cause = e;
throw error;
}

if(!parsed.protocol) {
throw new TypeError(`"${propertyName}" must be a URI: "${id}".`);
}
}

0 comments on commit 218cc6e

Please sign in to comment.