Comparing version 2.0.0 to 3.0.0
@@ -0,1 +1,11 @@ | ||
# [3.0.0](https://github.com/ipfs/is-ipfs/compare/v2.0.0...v3.0.0) (2021-02-03) | ||
### Features | ||
* dnsaddr support in peerMultiaddr ([#35](https://github.com/ipfs/is-ipfs/issues/35)) ([4a4710d](https://github.com/ipfs/is-ipfs/commit/4a4710d13b546d8271c6b5f60f214c9010139666)) | ||
* **subdomain:** support inlined DNSLink names ([#36](https://github.com/ipfs/is-ipfs/issues/36)) ([7ab7125](https://github.com/ipfs/is-ipfs/commit/7ab712538fa9a8aee4a3d2cd3496371a8cf0e78b)) | ||
<a name="2.0.0"></a> | ||
@@ -2,0 +12,0 @@ # [2.0.0](https://github.com/ipfs/is-ipfs/compare/v1.0.3...v2.0.0) (2020-08-10) |
{ | ||
"name": "is-ipfs", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "A set of utilities to help identify IPFS resources on the web", | ||
@@ -44,16 +44,16 @@ "keywords": [ | ||
"dependencies": { | ||
"cids": "^1.0.0", | ||
"iso-url": "~0.4.7", | ||
"mafmt": "^8.0.0", | ||
"multiaddr": "^8.0.0", | ||
"multibase": "^3.0.0", | ||
"multihashes": "^3.0.1", | ||
"uint8arrays": "^1.1.0" | ||
"cids": "^1.1.5", | ||
"iso-url": "^1.0.0", | ||
"mafmt": "^8.0.4", | ||
"multiaddr": "^8.1.2", | ||
"multibase": "^3.1.1", | ||
"multihashes": "^3.1.2", | ||
"uint8arrays": "^2.0.5" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^25.0.0", | ||
"aegir": "^30.3.0", | ||
"pre-commit": "^1.2.2" | ||
}, | ||
"engines": { | ||
"node": ">=10.0.0", | ||
"node": ">=14.0.0", | ||
"npm": ">=6.0.0" | ||
@@ -60,0 +60,0 @@ }, |
@@ -117,3 +117,5 @@ is-ipfs 🕵️ | ||
isIPFS.peerMultiaddr('/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4/p2p-circuit/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj') // true | ||
isIPFS.peerMultiaddr('/ip4/127.0.0.1/udp/1234') // false | ||
isIPFS.peerMultiaddr('/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN') // true | ||
isIPFS.peerMultiaddr('/dnsaddr/bootstrap.libp2p.io') // true (key resolved via DNS) | ||
isIPFS.peerMultiaddr('/ip4/127.0.0.1/udp/1234') // false (key missing) | ||
``` | ||
@@ -220,3 +222,3 @@ | ||
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. | ||
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Uint8Array` represents a valid libp2p peer multiaddr (matching [`P2P` format from `mafmt`](https://github.com/multiformats/js-mafmt#api)) or `false` otherwise. | ||
@@ -223,0 +225,0 @@ # License |
@@ -63,3 +63,3 @@ 'use strict' | ||
function isPeerMultiaddr (input) { | ||
return isMultiaddr(input) && mafmt.IPFS.matches(input) | ||
return isMultiaddr(input) && (mafmt.P2P.matches(input) || mafmt.DNS.matches(input)) | ||
} | ||
@@ -119,2 +119,8 @@ | ||
try { | ||
if (!ipnsId.includes('.') && ipnsId.includes('-')) { | ||
// name without tld, assuming its inlined into a single DNS label | ||
// (https://github.com/ipfs/in-web-browsers/issues/169) | ||
// en-wikipedia--on--ipfs-org → en.wikipedia-on-ipfs.org | ||
ipnsId = ipnsId.replace(/--/g, '@').replace(/-/g, '.').replace(/@/g, '-') | ||
} | ||
// URL implementation in web browsers forces lowercase of the hostname | ||
@@ -121,0 +127,0 @@ const { hostname } = new URL(`http://${ipnsId}`) // eslint-disable-line no-new |
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
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
0
100
154
226
0
24268
5
+ Addediso-url@1.2.1(transitive)
- Removediso-url@0.4.7(transitive)
Updatedcids@^1.1.5
Updatediso-url@^1.0.0
Updatedmafmt@^8.0.4
Updatedmultiaddr@^8.1.2
Updatedmultibase@^3.1.1
Updatedmultihashes@^3.1.2
Updateduint8arrays@^2.0.5