Skip to content

Commit

Permalink
fix: double validate (#25)
Browse files Browse the repository at this point in the history
We don't need to check a CID is a CID immediately after it's created 😉.

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
  • Loading branch information
Alan Shaw authored and lidel committed Feb 11, 2019
1 parent 8804b66 commit 8f8616f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function isMultibase (hash) {

function isCID (hash) {
try {
return CID.isCID(new CID(hash))
new CID(hash) // eslint-disable-line no-new
return true
} catch (e) {
return false
}
Expand Down

0 comments on commit 8f8616f

Please sign in to comment.