Comparing version 1.0.3 to 2.0.0
@@ -0,1 +1,18 @@ | ||
<a name="2.0.0"></a> | ||
# [2.0.0](https://github.com/ipfs/is-ipfs/compare/v1.0.3...v2.0.0) (2020-08-10) | ||
### Bug Fixes | ||
* replace node buffers with uint8arrays ([#34](https://github.com/ipfs/is-ipfs/issues/34)) ([ac5ec19](https://github.com/ipfs/is-ipfs/commit/ac5ec19)) | ||
### BREAKING CHANGES | ||
* this module now only has deps that use Uint8Arrays and not Buffers | ||
Co-authored-by: Marcin Rataj <lidel@lidel.org> | ||
<a name="1.0.3"></a> | ||
@@ -2,0 +19,0 @@ ## [1.0.3](https://github.com/ipfs/is-ipfs/compare/v1.0.2...v1.0.3) (2020-04-22) |
@@ -7,1 +7,3 @@ /*! | ||
*/ | ||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ |
{ | ||
"name": "is-ipfs", | ||
"version": "1.0.3", | ||
"version": "2.0.0", | ||
"description": "A set of utilities to help identify IPFS resources on the web", | ||
@@ -44,14 +44,12 @@ "keywords": [ | ||
"dependencies": { | ||
"buffer": "^5.6.0", | ||
"cids": "~0.8.0", | ||
"cids": "^1.0.0", | ||
"iso-url": "~0.4.7", | ||
"mafmt": "^7.1.0", | ||
"multiaddr": "^7.4.3", | ||
"multibase": "~0.7.0", | ||
"multihashes": "~0.4.19" | ||
"mafmt": "^8.0.0", | ||
"multiaddr": "^8.0.0", | ||
"multibase": "^3.0.0", | ||
"multihashes": "^3.0.1", | ||
"uint8arrays": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^21.4.5", | ||
"bs58": "^4.0.1", | ||
"chai": "^4.2.0", | ||
"aegir": "^25.0.0", | ||
"pre-commit": "^1.2.2" | ||
@@ -73,2 +71,3 @@ }, | ||
"nginnever <ginneversource@gmail.com>", | ||
"Alex Potsides <alex@achingbrain.net>", | ||
"Henrique Dias <hacdias@gmail.com>", | ||
@@ -75,0 +74,0 @@ "Hugo Dias <mail@hugodias.me>" |
@@ -215,7 +215,7 @@ is-ipfs 🕵️ | ||
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Buffer` represents a valid multiaddr or `false` otherwise. | ||
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Uint8Array` represents a valid multiaddr or `false` otherwise. | ||
### `isIPFS.peerMultiaddr(addr)` | ||
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Buffer` represents a valid "IPFS Peer" multiaddr (matching [`IPFS` format from `mafmt`](https://github.com/multiformats/js-mafmt#api)) or `false` otherwise. | ||
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Uint8Array` represents a valid "IPFS Peer" multiaddr (matching [`IPFS` format from `mafmt`](https://github.com/multiformats/js-mafmt#api)) or `false` otherwise. | ||
@@ -222,0 +222,0 @@ # License |
'use strict' | ||
const { Buffer } = require('buffer') | ||
const multihash = require('multihashes') | ||
@@ -10,2 +9,3 @@ const multibase = require('multibase') | ||
const { URL } = require('iso-url') | ||
const uint8ArrayToString = require('uint8arrays/to-string') | ||
@@ -136,4 +136,4 @@ const pathGatewayPattern = /^https?:\/\/[^/]+\/(ip[fn]s)\/([^/?#]+)/ | ||
function convertToString (input) { | ||
if (Buffer.isBuffer(input)) { | ||
return multibase.encode('base58btc', input).toString().slice(1) | ||
if (input instanceof Uint8Array) { | ||
return uint8ArrayToString(input, 'base58btc') | ||
} | ||
@@ -140,0 +140,0 @@ |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
2
98572
7
149
1
+ Addeduint8arrays@^1.1.0
+ Added@multiformats/base-x@4.0.1(transitive)
+ Added@zxing/text-encoding@0.9.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcids@1.1.9(transitive)
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddns-over-http-resolver@1.2.3(transitive)
+ Addederr-code@2.0.3(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedmafmt@8.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addedmultiaddr@8.1.2(transitive)
+ Addedmultibase@3.1.24.0.6(transitive)
+ Addedmulticodec@3.2.1(transitive)
+ Addedmultiformats@9.9.0(transitive)
+ Addedmultihashes@3.1.24.0.3(transitive)
+ Addednative-fetch@3.0.0(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedreceptacle@1.3.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addeduint8arrays@1.1.02.1.103.1.1(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedvarint@6.0.0(transitive)
+ Addedweb-encoding@1.1.5(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
- Removedbuffer@^5.6.0
- Removedbase-x@3.0.10(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcids@0.8.3(transitive)
- Removedieee754@1.2.1(transitive)
- Removedmafmt@7.1.0(transitive)
- Removedmultiaddr@7.5.0(transitive)
- Removedmultibase@0.7.01.0.1(transitive)
- Removedmulticodec@1.0.4(transitive)
- Removedmultihashes@0.4.211.0.1(transitive)
- Removedsafe-buffer@5.2.1(transitive)
Updatedcids@^1.0.0
Updatedmafmt@^8.0.0
Updatedmultiaddr@^8.0.0
Updatedmultibase@^3.0.0
Updatedmultihashes@^3.0.1