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

Commit

Permalink
deps: update it-* deps to latest versions (#450)
Browse files Browse the repository at this point in the history
`it-pipe` can now detect async/vs sync pipelines so update to the
latest version.
  • Loading branch information
achingbrain authored Apr 3, 2023
1 parent 85ff985 commit 0d07558
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@
"datastore-core": "^9.0.1",
"hashlru": "^2.3.0",
"interface-datastore": "^8.0.0",
"it-all": "^2.0.0",
"it-drain": "^2.0.0",
"it-first": "^2.0.0",
"it-length": "^2.0.0",
"it-length-prefixed": "^8.0.2",
"it-all": "^3.0.1",
"it-drain": "^3.0.1",
"it-first": "^3.0.1",
"it-length": "^3.0.1",
"it-length-prefixed": "^9.0.0",
"it-map": "^3.0.1",
"it-merge": "^2.0.0",
"it-merge": "^3.0.0",
"it-parallel": "^3.0.0",
"it-pipe": "^2.0.3",
"it-pipe": "^3.0.0",
"it-stream-types": "^1.0.4",
"it-take": "^3.0.1",
"k-bucket": "^5.1.0",
Expand All @@ -199,7 +199,7 @@
"datastore-level": "^10.0.0",
"delay": "^5.0.0",
"execa": "^7.0.0",
"it-filter": "^2.0.0",
"it-filter": "^3.0.1",
"it-last": "^3.0.1",
"lodash.random": "^3.2.0",
"lodash.range": "^3.2.0",
Expand Down
6 changes: 3 additions & 3 deletions src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class Network extends EventEmitter<NetworkEvents> implements Startable {

await pipe(
[msg],
lp.encode(),
(source) => lp.encode(source),
stream,
drain
)
Expand All @@ -174,9 +174,9 @@ export class Network extends EventEmitter<NetworkEvents> implements Startable {

const res = await pipe(
[msg],
lp.encode(),
(source) => lp.encode(source),
stream,
lp.decode(),
(source) => lp.decode(source),
async source => {
const buf = await first(source)

Expand Down
4 changes: 2 additions & 2 deletions src/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class RPC {

await pipe(
stream,
lp.decode(),
(source) => lp.decode(source),
async function * (source) {
for await (const msg of source) {
// handle the message
Expand All @@ -104,7 +104,7 @@ export class RPC {
}
}
},
lp.encode(),
(source) => lp.encode(source),
stream
)
})
Expand Down
6 changes: 3 additions & 3 deletions test/network.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ describe('Network', () => {

const data = await pipe(
[msg.serialize()],
lp.encode(),
(source) => lp.encode(source),
source => map(source, arr => new Uint8ArrayList(arr)),
async (source) => await all(source)
async (source) => all(source)
)

const source = (function * () {
Expand All @@ -77,7 +77,7 @@ describe('Network', () => {
const sink: Sink<Uint8ArrayList | Uint8Array> = async source => {
const res = await pipe(
source,
lp.decode(),
(source) => lp.decode(source),
async (source) => await all(source)
)
expect(Message.deserialize(res[0]).type).to.eql(MESSAGE_TYPE.PING)
Expand Down
8 changes: 4 additions & 4 deletions test/rpc/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ describe('rpc', () => {

peerRouting.getCloserPeersOffline.resolves([])

const source = await pipe(
const source = pipe(
[msg.serialize()],
lp.encode(),
(source) => lp.encode(source),
source => map(source, arr => new Uint8ArrayList(arr)),
async (source) => await all(source)
(source) => all(source)
)

const duplexStream: Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array> = {
source,
sink: async (source) => {
const res = await pipe(
source,
lp.decode(),
(source) => lp.decode(source),
async (source) => await all(source)
)
validateMessage(res)
Expand Down

0 comments on commit 0d07558

Please sign in to comment.