fix: private ip ts compile has no call signatures (#1020)

This commit is contained in:
Vasco Santos
2021-11-12 09:34:44 +00:00
committed by GitHub
parent a335fda852
commit 77d7cb8f08

View File

@ -10,7 +10,6 @@ const log = Object.assign(debug('libp2p:nat'), {
})
const { isBrowser } = require('wherearewe')
const retry = require('p-retry')
// @ts-ignore private-api does not export types
const isPrivateIp = require('private-ip')
const pkg = require('../package.json')
const errcode = require('err-code')
@ -115,6 +114,7 @@ class NatManager {
const client = this._getClient()
const publicIp = this._externalIp || await client.externalIp()
// @ts-ignore isPrivate has no call signatures
if (isPrivateIp(publicIp)) {
throw new Error(`${publicIp} is private - please set config.nat.externalIp to an externally routable IP or ensure you are not behind a double NAT`)
}