@libp2p/utils
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,8 +0,6 @@ | ||
import debug from 'debug'; | ||
import { logger } from '@libp2p/logger'; | ||
import { Multiaddr } from '@multiformats/multiaddr'; | ||
import errCode from 'err-code'; | ||
import { Address4, Address6 } from '@achingbrain/ip-address'; | ||
const log = Object.assign(debug('libp2p:ip-port-to-multiaddr'), { | ||
error: debug('libp2p:ip-port-to-multiaddr:err') | ||
}); | ||
const log = logger('libp2p:ip-port-to-multiaddr'); | ||
export const Errors = { | ||
@@ -9,0 +7,0 @@ ERR_INVALID_IP_PARAMETER: 'ERR_INVALID_IP_PARAMETER', |
@@ -1,2 +0,2 @@ | ||
import type { MuxedStream } from '@libp2p/interfaces/stream-muxer'; | ||
import type { Stream } from '@libp2p/interfaces/connection'; | ||
import type { Multiaddr } from '@multiformats/multiaddr'; | ||
@@ -28,3 +28,3 @@ import type { MultiaddrConnection } from '@libp2p/interfaces/transport'; | ||
interface StreamProperties { | ||
stream: MuxedStream; | ||
stream: Stream; | ||
remoteAddr: Multiaddr; | ||
@@ -31,0 +31,0 @@ localAddr: Multiaddr; |
import { abortableSource } from 'abortable-iterator'; | ||
import debug from 'debug'; | ||
const log = debug('libp2p:stream:converter'); | ||
import { logger } from '@libp2p/logger'; | ||
const log = logger('libp2p:stream:converter'); | ||
/** | ||
@@ -9,3 +9,3 @@ * Convert a duplex iterable into a MultiaddrConnection. | ||
export function streamToMaConnection(props, options = {}) { | ||
const { stream, remoteAddr, localAddr } = props; | ||
const { stream, remoteAddr } = props; | ||
const { sink, source } = stream; | ||
@@ -32,4 +32,2 @@ const maConn = { | ||
source: (options.signal != null) ? abortableSource(source, options.signal) : source, | ||
conn: stream, | ||
localAddr, | ||
remoteAddr, | ||
@@ -36,0 +34,0 @@ /** @type {Timeline} */ |
{ | ||
"name": "@libp2p/utils", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem", | ||
@@ -46,10 +46,2 @@ "license": "Apache-2.0 OR MIT", | ||
}, | ||
"./multiaddr/is-loopback": { | ||
"import": "./dist/src/multiaddr/is-loopback.js", | ||
"types": "./dist/src/multiaddr/is-loopback.d.ts" | ||
}, | ||
"./multiaddr/is-private": { | ||
"import": "./dist/src/multiaddr/is-private.js", | ||
"types": "./dist/src/multiaddr/is-private.d.ts" | ||
}, | ||
"./address-sort": { | ||
@@ -67,2 +59,10 @@ "import": "./dist/src/address-sort.js", | ||
}, | ||
"./multiaddr/is-loopback": { | ||
"import": "./dist/src/multiaddr/is-loopback.js", | ||
"types": "./dist/src/multiaddr/is-loopback.d.ts" | ||
}, | ||
"./multiaddr/is-private": { | ||
"import": "./dist/src/multiaddr/is-private.js", | ||
"types": "./dist/src/multiaddr/is-private.d.ts" | ||
}, | ||
"./stream-to-ma-conn": { | ||
@@ -165,4 +165,4 @@ "import": "./dist/src/stream-to-ma-connr.js", | ||
"pretest": "npm run build", | ||
"test": "aegir test -f ./dist/test/**/*.js", | ||
"test:chrome": "npm run test -- -t browser", | ||
"test": "aegir test -f ./dist/test/*.js -f ./dist/test/**/*.js", | ||
"test:chrome": "npm run test -- -t browser --cov", | ||
"test:chrome-webworker": "npm run test -- -t webworker", | ||
@@ -177,5 +177,5 @@ "test:firefox": "npm run test -- -t browser -- --browser firefox", | ||
"@achingbrain/ip-address": "^8.1.0", | ||
"@libp2p/logger": "^1.0.1", | ||
"@multiformats/multiaddr": "^10.1.1", | ||
"abortable-iterator": "^4.0.2", | ||
"debug": "^4.3.0", | ||
"err-code": "^3.0.1", | ||
@@ -187,9 +187,7 @@ "is-loopback-addr": "^2.0.1", | ||
"@libp2p/interfaces": "^1.0.3", | ||
"@types/debug": "^4.1.5", | ||
"aegir": "^36.1.2", | ||
"it-all": "^1.0.6", | ||
"it-pair": "^2.0.2", | ||
"it-pipe": "^2.0.2", | ||
"streaming-iterables": "^6.0.0", | ||
"util": "^0.12.3" | ||
"it-pipe": "^2.0.2" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import debug from 'debug' | ||
import { logger } from '@libp2p/logger' | ||
import { Multiaddr } from '@multiformats/multiaddr' | ||
@@ -6,5 +6,3 @@ import errCode from 'err-code' | ||
const log = Object.assign(debug('libp2p:ip-port-to-multiaddr'), { | ||
error: debug('libp2p:ip-port-to-multiaddr:err') | ||
}) | ||
const log = logger('libp2p:ip-port-to-multiaddr') | ||
@@ -11,0 +9,0 @@ export const Errors = { |
import { abortableSource } from 'abortable-iterator' | ||
import debug from 'debug' | ||
import type { MuxedStream } from '@libp2p/interfaces/stream-muxer' | ||
import { logger } from '@libp2p/logger' | ||
import type { Stream } from '@libp2p/interfaces/connection' | ||
import type { Multiaddr } from '@multiformats/multiaddr' | ||
import type { MultiaddrConnection } from '@libp2p/interfaces/transport' | ||
const log = debug('libp2p:stream:converter') | ||
const log = logger('libp2p:stream:converter') | ||
@@ -39,3 +39,3 @@ /** | ||
interface StreamProperties { | ||
stream: MuxedStream | ||
stream: Stream | ||
remoteAddr: Multiaddr | ||
@@ -50,3 +50,3 @@ localAddr: Multiaddr | ||
export function streamToMaConnection (props: StreamProperties, options: StreamOptions = {}) { | ||
const { stream, remoteAddr, localAddr } = props | ||
const { stream, remoteAddr } = props | ||
const { sink, source } = stream | ||
@@ -73,4 +73,2 @@ const maConn: MultiaddrConnection = { | ||
source: (options.signal != null) ? abortableSource(source, options.signal) : source, | ||
conn: stream, | ||
localAddr, | ||
remoteAddr, | ||
@@ -77,0 +75,0 @@ /** @type {Timeline} */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
5
28896
414
+ Added@libp2p/logger@^1.0.1
+ Added@libp2p/interfaces@2.0.4(transitive)
+ Added@libp2p/logger@1.1.6(transitive)
+ Addedinterface-datastore@6.1.1(transitive)
+ Addedinterface-store@2.0.2(transitive)
+ Addedit-pushable@2.0.2(transitive)
+ Addednanoid@3.3.7(transitive)
- Removeddebug@^4.3.0