mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Fix handling of missing opts
This commit is contained in:
parent
1eb98349d2
commit
656ac3541d
1 changed files with 3 additions and 1 deletions
|
@ -44,13 +44,15 @@ const matchSp = (uri) => {
|
|||
}
|
||||
|
||||
const verify = (uri, fingerprint, opts) => {
|
||||
if (!opts) { opts = {} }
|
||||
|
||||
if (!validUrl.isUri(uri)) {
|
||||
throw new Error('Not a valid URI')
|
||||
}
|
||||
|
||||
const spMatches = matchSp(uri)
|
||||
|
||||
if (opts.returnMatchesOnly) {
|
||||
if ('returnMatchesOnly' in opts && opts.returnMatchesOnly) {
|
||||
return spMatches
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue