diff --git a/src/index.js b/src/index.js index 16b4976..200c889 100644 --- a/src/index.js +++ b/src/index.js @@ -21,14 +21,14 @@ const claimVerification = require('./claimVerification') const utils = require('./utils') const verify = async (uri, fingerprint, opts) => { - if (!opts) { opts = {} } if (!fingerprint) { fingerprint = null } + if (!opts) { opts = {} } if (!validUrl.isUri(uri)) { throw new Error('Not a valid URI') } - const spMatches = serviceproviders.match(uri, fingerprint) + const spMatches = serviceproviders.match(uri, opts) if ('returnMatchesOnly' in opts && opts.returnMatchesOnly) { return spMatches diff --git a/src/serviceproviders.js b/src/serviceproviders.js index 7d53436..18e1951 100644 --- a/src/serviceproviders.js +++ b/src/serviceproviders.js @@ -27,13 +27,13 @@ const data = { hackernews: require('./serviceproviders/hackernews'), } -const match = (uri) => { +const match = (uri, opts) => { let matches = [], sp list.forEach((spName, i) => { sp = data[spName] if (sp.reURI.test(uri)) { - matches.push(sp.processURI(uri)) + matches.push(sp.processURI(uri, opts)) } })