chore: remove unneeded deps

License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Jacob Heun 2019-02-26 19:18:35 +01:00
parent eedc264a9a
commit ea762d12ee
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F
3 changed files with 9 additions and 10 deletions

View File

@ -4,6 +4,10 @@
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces", "description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>", "leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
"main": "src/index.js", "main": "src/index.js",
"files": [
"dist",
"src"
],
"scripts": { "scripts": {
"lint": "aegir lint", "lint": "aegir lint",
"test": "aegir test -t node -f test/**/*.js", "test": "aegir test -t node -f test/**/*.js",
@ -45,8 +49,6 @@
"debug": "^4.1.1", "debug": "^4.1.1",
"interface-connection": "~0.3.3", "interface-connection": "~0.3.3",
"ip-address": "^5.8.9", "ip-address": "^5.8.9",
"lodash.includes": "^4.3.0",
"lodash.isfunction": "^3.0.9",
"mafmt": "^6.0.6", "mafmt": "^6.0.6",
"multiaddr": "^6.0.5", "multiaddr": "^6.0.5",
"once": "^1.4.0", "once": "^1.4.0",

View File

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

View File

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