Skip to content

Commit 2b2958f

Browse files
deps: bump stream-to-it from 0.2.4 to 1.0.0 (#2474)
Bumps [stream-to-it](https://github.com/alanshaw/stream-to-it) from 0.2.4 to 1.0.0. - [Release notes](https://github.com/alanshaw/stream-to-it/releases) - [Changelog](https://github.com/alanshaw/stream-to-it/blob/master/CHANGELOG.md) - [Commits](alanshaw/stream-to-it@v0.2.4...v1.0.0) --- updated-dependencies: - dependency-name: stream-to-it dependency-type: direct:production update-type: version-update:semver-major ... --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <[email protected]>
1 parent 9211de1 commit 2b2958f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/transport-tcp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@multiformats/mafmt": "^12.1.6",
6262
"@multiformats/multiaddr": "^12.2.1",
6363
"@types/sinon": "^17.0.3",
64-
"stream-to-it": "^0.2.4"
64+
"stream-to-it": "^1.0.0"
6565
},
6666
"devDependencies": {
6767
"@libp2p/interface-compliance-tests": "^5.3.4",

packages/transport-tcp/src/socket-to-conn.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { CodeError } from '@libp2p/interface'
22
import { ipPortToMultiaddr as toMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr'
3-
// @ts-expect-error no types
4-
import toIterable from 'stream-to-it'
3+
import { duplex } from 'stream-to-it'
54
import { CLOSE_TIMEOUT, SOCKET_TIMEOUT } from './constants.js'
65
import { multiaddrToNetConfig } from './utils.js'
76
import type { ComponentLogger, MultiaddrConnection, CounterGroup } from '@libp2p/interface'
@@ -55,7 +54,7 @@ export const toMultiaddrConnection = (socket: Socket, options: ToConnectionOptio
5554

5655
const lOpts = multiaddrToNetConfig(remoteAddr)
5756
const lOptsStr = lOpts.path ?? `${lOpts.host ?? ''}:${lOpts.port ?? ''}`
58-
const { sink, source } = toIterable.duplex(socket)
57+
const { sink, source } = duplex(socket)
5958

6059
// by default there is no timeout
6160
// https://nodejs.org/dist/latest-v16.x/docs/api/net.html#socketsettimeouttimeout-callback
@@ -109,7 +108,7 @@ export const toMultiaddrConnection = (socket: Socket, options: ToConnectionOptio
109108
// If aborted we can safely ignore
110109
if (err.type !== 'aborted') {
111110
// If the source errored the socket will already have been destroyed by
112-
// toIterable.duplex(). If the socket errored it will already be
111+
// duplex(). If the socket errored it will already be
113112
// destroyed. There's nothing to do here except log the error & return.
114113
log.error('%s error in sink', lOptsStr, err)
115114
}

0 commit comments

Comments
 (0)