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

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo Dias <hugomrdias@gmail.com>
  • Loading branch information
vasco-santos and hugomrdias committed Apr 6, 2021
1 parent c92a92c commit f510e8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/ip-port-to-multiaddr.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ function ipPortToMultiaddr (ip, port) {
throw errCode(new Error(`invalid ip provided: ${ip}`), errors.ERR_INVALID_IP_PARAMETER)
}

// @ts-ignore parseInt expects only string
port = parseInt(port)
if (typeof port === 'string') {
port = parseInt(port)
}

if (isNaN(port)) {
throw errCode(new Error(`invalid port provided: ${port}`), errors.ERR_INVALID_PORT_PARAMETER)
Expand Down
2 changes: 1 addition & 1 deletion src/stream-to-ma-conn.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function streamToMaConnection ({ stream, remoteAddr, localAddr }, options = {})
*/
async sink (source) {
if (options.signal) {
// @ts-ignore abortable has no type definitions
// @ts-ignore ts infers source template will be a number
source = abortable(source, options.signal)
}

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "./node_modules/aegir/src/config/tsconfig.aegir.json",
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"src"
]
}
}

0 comments on commit f510e8f

Please sign in to comment.