Socket
Socket
Sign inDemoInstall

is-ipfs

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-ipfs - npm Package Compare versions

Comparing version 0.0.2 to 0.0.4

4

index.js
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/')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc