chore: update dependencies and cleanup usage

License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Jacob Heun
2018-11-08 16:32:33 +01:00
parent 3ab43a3604
commit 1cd0066755
3 changed files with 9 additions and 15 deletions

View File

@@ -34,22 +34,19 @@
"npm": ">=3.0.0"
},
"devDependencies": {
"aegir": "^15.1.0",
"chai": "^4.1.2",
"aegir": "^17.0.1",
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"interface-transport": "~0.3.6",
"lodash.isfunction": "^3.0.9",
"pull-stream": "^3.6.9"
},
"dependencies": {
"class-is": "^1.1.0",
"debug": "^3.1.0",
"debug": "^4.1.0",
"interface-connection": "~0.3.2",
"ip-address": "^5.8.9",
"lodash.includes": "^4.3.0",
"lodash.isfunction": "^3.0.9",
"mafmt": "^6.0.2",
"multiaddr": "^5.0.0",
"multiaddr": "^5.0.2",
"once": "^1.4.0",
"stream-to-pull-stream": "^1.7.2"
},

View File

@@ -4,8 +4,6 @@ const net = require('net')
const toPull = require('stream-to-pull-stream')
const mafmt = require('mafmt')
const withIs = require('class-is')
const includes = require('lodash.includes')
const isFunction = require('lodash.isfunction')
const Connection = require('interface-connection').Connection
const once = require('once')
const debug = require('debug')
@@ -17,7 +15,7 @@ function noop () {}
class TCP {
dial (ma, options, callback) {
if (isFunction(options)) {
if (typeof options === 'function') {
callback = options
options = {}
}
@@ -53,7 +51,7 @@ class TCP {
}
createListener (options, handler) {
if (isFunction(options)) {
if (typeof options === 'function') {
handler = options
options = {}
}
@@ -69,11 +67,11 @@ class TCP {
}
return multiaddrs.filter((ma) => {
if (includes(ma.protoNames(), 'p2p-circuit')) {
if (ma.protoNames().includes('p2p-circuit')) {
return false
}
if (includes(ma.protoNames(), 'ipfs')) {
if (ma.protoNames().includes('ipfs')) {
ma = ma.decapsulate('ipfs')
}

View File

@@ -3,7 +3,6 @@
const multiaddr = require('multiaddr')
const Connection = require('interface-connection').Connection
const os = require('os')
const includes = require('lodash.includes')
const net = require('net')
const toPull = require('stream-to-pull-stream')
const EventEmitter = require('events').EventEmitter
@@ -84,7 +83,7 @@ module.exports = (handler) => {
listener.listen = (ma, callback) => {
listeningAddr = ma
if (includes(ma.protoNames(), 'ipfs')) {
if (ma.protoNames().includes('ipfs')) {
ipfsId = getIpfsId(ma)
listeningAddr = ma.decapsulate('ipfs')
}