chore: fix lint

This commit is contained in:
Jacob Heun 2020-10-15 16:29:33 +02:00
parent d7e113b3db
commit 3d14678de8
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F
2 changed files with 8 additions and 8 deletions

View File

@ -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
} }

View File

@ -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)
})() })()
}) })
}) })
} }