fix: remove inline arg types from function definitions (#916)

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
This commit is contained in:
Alex Potsides 2021-04-19 13:08:00 +01:00 committed by GitHub
parent 906315ce73
commit 2af692fb4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -104,7 +104,7 @@
"it-pipe": "^1.1.0",
"it-take": "1.0.0",
"libp2p-crypto": "^0.19.0",
"libp2p-interfaces": "^0.10.0",
"libp2p-interfaces": "^0.10.1",
"libp2p-utils": "^0.3.1",
"mafmt": "^9.0.0",
"merge-options": "^3.0.4",

View File

@ -222,6 +222,7 @@ class Upgrader {
}) {
/** @type {import("libp2p-interfaces/src/stream-muxer/types").Muxer} */
let muxer
/** @type {import("libp2p-interfaces/src/connection/connection").CreatedMuxedStream | undefined} */
let newStream
/** @type {Connection} */
let connection // eslint-disable-line prefer-const
@ -249,7 +250,7 @@ class Upgrader {
}
})
newStream = async (/** @type {string | string[]} */ protocols) => {
newStream = async (protocols) => {
log('%s: starting new stream on %s', direction, protocols)
const muxedStream = muxer.newStream()
const mss = new Multistream.Dialer(muxedStream)
@ -309,8 +310,8 @@ class Upgrader {
},
newStream: newStream || errConnectionNotMultiplexed,
getStreams: () => muxer ? muxer.streams : errConnectionNotMultiplexed(),
close: async (/** @type {Error | undefined} */ err) => {
await maConn.close(err)
close: async () => {
await maConn.close()
// Ensure remaining streams are aborted
if (muxer) {
muxer.streams.map(stream => stream.abort())

View File

@ -9,7 +9,7 @@
"libp2p-delegated-content-routing": "^0.9.0",
"libp2p-delegated-peer-routing": "^0.8.2",
"libp2p-gossipsub": "^0.8.0",
"libp2p-interfaces": "^0.8.4",
"libp2p-interfaces": "^0.10.1",
"libp2p-kad-dht": "^0.21.0",
"libp2p-mplex": "^0.10.2",
"libp2p-noise": "^2.0.5",