Skip to content

Commit

Permalink
chore: remove url from node globals
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Apr 13, 2021
1 parent e69eba6 commit 8e91334
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/libp2p-in-the-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"libp2p-bootstrap": "^0.12.1",
"libp2p-mplex": "^0.10.0",
"libp2p-noise": "^2.0.0",
"libp2p-webrtc-star": "^0.20.0",
"libp2p-webrtc-star": "^0.22.0",
"libp2p-websockets": "^0.15.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/webrtc-direct/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"libp2p-bootstrap": "^0.12.1",
"libp2p-mplex": "^0.10.1",
"libp2p-noise": "^2.0.1",
"libp2p-webrtc-direct": "^0.5.0",
"libp2p-webrtc-direct": "^0.6.0",
"peer-id": "^0.14.3"
},
"browser": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"@types/varint": "^6.0.0",
"abortable-iterator": "^3.0.0",
"aegir": "^33.0.0",
"buffer": "^6.0.3",
"chai-bytes": "^0.1.2",
"chai-string": "^1.5.0",
"delay": "^5.0.0",
Expand All @@ -157,7 +158,7 @@
"libp2p-mplex": "^0.10.1",
"libp2p-noise": "^2.0.0",
"libp2p-tcp": "^0.15.1",
"libp2p-webrtc-star": "^0.21.2",
"libp2p-webrtc-star": "^0.22.0",
"libp2p-websockets": "^0.15.0",
"multihashes": "^4.0.2",
"nock": "^13.0.3",
Expand All @@ -167,7 +168,6 @@
"rimraf": "^3.0.2",
"sinon": "^10.0.0",
"uint8arrays": "^2.1.3",
"url": "^0.11.0",
"util": "^0.12.3"
},
"contributors": [
Expand Down
1 change: 0 additions & 1 deletion scripts/node-globals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// @ts-nocheck
export const { Buffer } = require('buffer')
export const url = require('url')
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const mergeOptions = require('merge-options')
// @ts-ignore no types in multiaddr
// @ts-ignore no types in multiaddr path
const { dnsaddrResolver } = require('multiaddr/src/resolvers')

const Constants = require('./constants')
Expand Down
5 changes: 0 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ class Libp2p extends EventEmitter {
this._discovery = new Map() // Discovery service instances/references

// Create the Connection Manager
// @ts-ignore deprecated, needs to be removed on breaking change
if (this._options.connectionManager.minPeers) {
// @ts-ignore deprecated, needs to be removed on breaking change
this._options.connectionManager.minConnections = this._options.connectionManager.minPeers
}
this.connectionManager = new ConnectionManager(this, {
autoDial: this._config.peerDiscovery.autoDial,
...this._options.connectionManager
Expand Down
1 change: 0 additions & 1 deletion src/insecure/plaintext.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const lp = require('it-length-prefixed')
const PeerId = require('peer-id')
const { UnexpectedPeerError, InvalidCryptoExchangeError } = require('libp2p-interfaces/src/crypto/errors')

// @ts-ignore protons do not export types
const { Exchange, KeyType } = require('./proto')
const protocol = '/plaintext/2.0.0'

Expand Down
4 changes: 0 additions & 4 deletions src/metrics/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,13 @@ class Stats extends EventEmitter {

/**
* Returns a clone of the current stats.
*
* @returns {Object}
*/
get snapshot () {
return Object.assign({}, this._stats)
}

/**
* Returns a clone of the internal movingAverages
*
* @returns {typeof Object.assign}
*/
get movingAverages () {
return Object.assign({}, this._movingAverages)
Expand Down

0 comments on commit 8e91334

Please sign in to comment.