mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-24 17:52:21 +00:00
chore: fix lint
This commit is contained in:
parent
d7e113b3db
commit
3d14678de8
@ -210,7 +210,7 @@ class Connection {
|
|||||||
*/
|
*/
|
||||||
async close () {
|
async close () {
|
||||||
this.streams.map(s => s.close && s.close())
|
this.streams.map(s => s.close && s.close())
|
||||||
|
|
||||||
if (this.stat.status === Status.CLOSED) {
|
if (this.stat.status === Status.CLOSED) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -122,14 +122,14 @@ module.exports = (common) => {
|
|||||||
const listener = new Muxer(async stream => {
|
const listener = new Muxer(async stream => {
|
||||||
// Immediate close for write
|
// Immediate close for write
|
||||||
await stream.closeWrite()
|
await stream.closeWrite()
|
||||||
|
|
||||||
const results = await pipe(stream, async (source) => {
|
const results = await pipe(stream, async (source) => {
|
||||||
const data = []
|
const data = []
|
||||||
for await (const chunk of source) {
|
for await (const chunk of source) {
|
||||||
data.push(chunk.slice())
|
data.push(chunk.slice())
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
expect(results).to.eql(data)
|
expect(results).to.eql(data)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -160,7 +160,7 @@ module.exports = (common) => {
|
|||||||
data.push(chunk.slice())
|
data.push(chunk.slice())
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
expect(results).to.eql(data)
|
expect(results).to.eql(data)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
@ -168,14 +168,14 @@ module.exports = (common) => {
|
|||||||
pipe(p[0], dialer, p[0])
|
pipe(p[0], dialer, p[0])
|
||||||
pipe(p[1], listener, p[1])
|
pipe(p[1], listener, p[1])
|
||||||
|
|
||||||
const stream = dialer.newStream()
|
const stream = dialer.newStream()
|
||||||
stream.closeRead()
|
stream.closeRead()
|
||||||
|
|
||||||
// Source should be done
|
// Source should be done
|
||||||
;(async () => {
|
;(async () => {
|
||||||
expect(await stream.source.next()).to.eql({ done: true })
|
expect(await stream.source.next()).to.eql({ done: true })
|
||||||
stream.sink(data)
|
stream.sink(data)
|
||||||
})()
|
})()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user