libp2p-utils
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -0,1 +1,24 @@ | ||
<a name="0.2.1"></a> | ||
## [0.2.1](https://github.com/libp2p/js-libp2p-utils/compare/v0.1.3...v0.2.1) (2020-10-08) | ||
### Chores | ||
* update deps ([#9](https://github.com/libp2p/js-libp2p-utils/issues/9)) ([a2ea68f](https://github.com/libp2p/js-libp2p-utils/commit/a2ea68f)) | ||
### Features | ||
* is multiaddr private and loopback ([#10](https://github.com/libp2p/js-libp2p-utils/issues/10)) ([d7fa562](https://github.com/libp2p/js-libp2p-utils/commit/d7fa562)) | ||
### BREAKING CHANGES | ||
* - The multiaddr dep of this module uses Uint8Arrays and may not be | ||
compatible with previous versions | ||
* chore: remove gh url | ||
<a name="0.2.0"></a> | ||
@@ -2,0 +25,0 @@ # [0.2.0](https://github.com/libp2p/js-libp2p-utils/compare/v0.1.3...v0.2.0) (2020-08-07) |
{ | ||
"name": "libp2p-utils", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem", | ||
@@ -32,18 +32,21 @@ "leadMaintainer": "Vasco Santos <santos.vasco10@gmail.com>", | ||
"devDependencies": { | ||
"aegir": "^25.0.0", | ||
"aegir": "^27.0.0", | ||
"it-pair": "^1.0.0", | ||
"it-pipe": "^1.1.0", | ||
"streaming-iterables": "^5.0.2" | ||
"streaming-iterables": "^5.0.3" | ||
}, | ||
"dependencies": { | ||
"abortable-iterator": "^3.0.0", | ||
"debug": "^4.1.1", | ||
"debug": "^4.2.0", | ||
"err-code": "^2.0.3", | ||
"ip-address": "^6.1.0", | ||
"multiaddr": "^8.0.0" | ||
"is-loopback-addr": "^1.0.0", | ||
"multiaddr": "^8.0.0", | ||
"private-ip": "^1.0.5" | ||
}, | ||
"contributors": [ | ||
"Vasco Santos <vasco.santos@moxy.studio>", | ||
"Jacob Heun <jacobheun@gmail.com>", | ||
"Alex Potsides <alex@achingbrain.net>" | ||
] | ||
} |
@@ -41,2 +41,4 @@ # js-libp2p-utils | ||
You can check the [API docs](./API.md). | ||
## Contribute | ||
@@ -43,0 +45,0 @@ |
@@ -5,3 +5,4 @@ 'use strict' | ||
* Verify if two arrays of non primitive types with the "equals" function are equal. | ||
* Compatible with multiaddr, peer-id and Buffer. | ||
* Compatible with multiaddr, peer-id and others. | ||
* | ||
* @param {Array<*>} a | ||
@@ -8,0 +9,0 @@ * @param {Array<*>} b |
@@ -13,3 +13,9 @@ 'use strict' | ||
module.exports = (ip, port) => { | ||
/** | ||
* Transform an IP, Port pair into a multiaddr | ||
* | ||
* @param {string} ip | ||
* @param {number|string} port | ||
*/ | ||
function ipPortToMultiaddr (ip, port) { | ||
if (typeof ip !== 'string') { | ||
@@ -40,2 +46,4 @@ throw errCode(new Error(`invalid ip provided: ${ip}`), errors.ERR_INVALID_IP_PARAMETER) | ||
module.exports = ipPortToMultiaddr | ||
module.exports.Errors = errors |
@@ -6,5 +6,14 @@ 'use strict' | ||
// Convert a duplex iterable into a MultiaddrConnection | ||
// https://github.com/libp2p/interface-transport#multiaddrconnection | ||
module.exports = ({ stream, remoteAddr, localAddr }, options = {}) => { | ||
/** | ||
* Convert a duplex iterable into a MultiaddrConnection. | ||
* https://github.com/libp2p/interface-transport#multiaddrconnection | ||
* | ||
* @param {object} streamProperties | ||
* @param {DuplexStream} streamProperties.stream | ||
* @param {Multiaddr} streamProperties.remoteAddr | ||
* @param {Multiaddr} streamProperties.localAddr | ||
* @param {object} [options] | ||
* @param {AbortSignal} [options.signal] | ||
*/ | ||
function streamToMaConnection ({ stream, remoteAddr, localAddr }, options = {}) { | ||
const { sink, source } = stream | ||
@@ -51,1 +60,3 @@ const maConn = { | ||
} | ||
module.exports = streamToMaConnection |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25008
17
369
52
0
7
+ Addedis-loopback-addr@^1.0.0
+ Addedprivate-ip@^1.0.5
+ Addedis-loopback-addr@1.0.1(transitive)
+ Addedprivate-ip@1.0.5(transitive)
Updateddebug@^4.2.0