Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 0d07558

Browse files
authored
deps: update it-* deps to latest versions (#450)
`it-pipe` can now detect async/vs sync pipelines so update to the latest version.
1 parent 85ff985 commit 0d07558

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@
165165
"datastore-core": "^9.0.1",
166166
"hashlru": "^2.3.0",
167167
"interface-datastore": "^8.0.0",
168-
"it-all": "^2.0.0",
169-
"it-drain": "^2.0.0",
170-
"it-first": "^2.0.0",
171-
"it-length": "^2.0.0",
172-
"it-length-prefixed": "^8.0.2",
168+
"it-all": "^3.0.1",
169+
"it-drain": "^3.0.1",
170+
"it-first": "^3.0.1",
171+
"it-length": "^3.0.1",
172+
"it-length-prefixed": "^9.0.0",
173173
"it-map": "^3.0.1",
174-
"it-merge": "^2.0.0",
174+
"it-merge": "^3.0.0",
175175
"it-parallel": "^3.0.0",
176-
"it-pipe": "^2.0.3",
176+
"it-pipe": "^3.0.0",
177177
"it-stream-types": "^1.0.4",
178178
"it-take": "^3.0.1",
179179
"k-bucket": "^5.1.0",
@@ -199,7 +199,7 @@
199199
"datastore-level": "^10.0.0",
200200
"delay": "^5.0.0",
201201
"execa": "^7.0.0",
202-
"it-filter": "^2.0.0",
202+
"it-filter": "^3.0.1",
203203
"it-last": "^3.0.1",
204204
"lodash.random": "^3.2.0",
205205
"lodash.range": "^3.2.0",

src/network.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class Network extends EventEmitter<NetworkEvents> implements Startable {
156156

157157
await pipe(
158158
[msg],
159-
lp.encode(),
159+
(source) => lp.encode(source),
160160
stream,
161161
drain
162162
)
@@ -174,9 +174,9 @@ export class Network extends EventEmitter<NetworkEvents> implements Startable {
174174

175175
const res = await pipe(
176176
[msg],
177-
lp.encode(),
177+
(source) => lp.encode(source),
178178
stream,
179-
lp.decode(),
179+
(source) => lp.decode(source),
180180
async source => {
181181
const buf = await first(source)
182182

src/rpc/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class RPC {
9090

9191
await pipe(
9292
stream,
93-
lp.decode(),
93+
(source) => lp.decode(source),
9494
async function * (source) {
9595
for await (const msg of source) {
9696
// handle the message
@@ -104,7 +104,7 @@ export class RPC {
104104
}
105105
}
106106
},
107-
lp.encode(),
107+
(source) => lp.encode(source),
108108
stream
109109
)
110110
})

test/network.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ describe('Network', () => {
6363

6464
const data = await pipe(
6565
[msg.serialize()],
66-
lp.encode(),
66+
(source) => lp.encode(source),
6767
source => map(source, arr => new Uint8ArrayList(arr)),
68-
async (source) => await all(source)
68+
async (source) => all(source)
6969
)
7070

7171
const source = (function * () {
@@ -77,7 +77,7 @@ describe('Network', () => {
7777
const sink: Sink<Uint8ArrayList | Uint8Array> = async source => {
7878
const res = await pipe(
7979
source,
80-
lp.decode(),
80+
(source) => lp.decode(source),
8181
async (source) => await all(source)
8282
)
8383
expect(Message.deserialize(res[0]).type).to.eql(MESSAGE_TYPE.PING)

test/rpc/index.node.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ describe('rpc', () => {
7878

7979
peerRouting.getCloserPeersOffline.resolves([])
8080

81-
const source = await pipe(
81+
const source = pipe(
8282
[msg.serialize()],
83-
lp.encode(),
83+
(source) => lp.encode(source),
8484
source => map(source, arr => new Uint8ArrayList(arr)),
85-
async (source) => await all(source)
85+
(source) => all(source)
8686
)
8787

8888
const duplexStream: Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array> = {
8989
source,
9090
sink: async (source) => {
9191
const res = await pipe(
9292
source,
93-
lp.decode(),
93+
(source) => lp.decode(source),
9494
async (source) => await all(source)
9595
)
9696
validateMessage(res)

0 commit comments

Comments
 (0)