Comparing version 0.0.2 to 0.0.4
const base58 = require('bs58') | ||
const multihash = require('multihashes') | ||
const urlPattern = /^https?:\/\/[^\/]+\/(ip(f|n)s)\/(\w+)/ | ||
const urlPattern = /^https?:\/\/[^\/]+\/(ip(f|n)s)\/((\w+).*)/ | ||
@@ -26,3 +26,3 @@ function isMultihash (hash) { | ||
const hash = match[3] | ||
const hash = match[4] | ||
return isMultihash(hash) | ||
@@ -29,0 +29,0 @@ } |
{ | ||
"name": "is-ipfs", | ||
"version": "0.0.2", | ||
"version": "0.0.4", | ||
"description": "A set of utilities to help identify IPFS resources", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,2 +25,9 @@ const test = require('tape') | ||
test('isIPFS.ipfsUrl should match a complex ipfs url', function (t) { | ||
const actual = isIPFS.ipfsUrl('http://ipfs.alexandria.media/ipfs/QmeWz9YZEeNFXQhHg4PnR5ZiNr5isttgi5n1tc1eD5EfGU/content/index.html') | ||
const expected = true | ||
t.is(actual, expected) | ||
t.end() | ||
}) | ||
test('isIPFS.ipfsUrl should not match an ipns url', function (t) { | ||
@@ -27,0 +34,0 @@ const actual = isIPFS.ipfsUrl('http://ipfs.io/ipns/github.com/') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7112
132