diff --git a/src/ip-port-to-multiaddr.js b/src/ip-port-to-multiaddr.js index 85a9751..7540f2e 100644 --- a/src/ip-port-to-multiaddr.js +++ b/src/ip-port-to-multiaddr.js @@ -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) diff --git a/src/stream-to-ma-conn.js b/src/stream-to-ma-conn.js index 55be5bb..b7040a5 100644 --- a/src/stream-to-ma-conn.js +++ b/src/stream-to-ma-conn.js @@ -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) } diff --git a/tsconfig.json b/tsconfig.json index 5b9a618..5fe8ea4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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" ] -} \ No newline at end of file +}