From ea762d12ee589ef9c3942d96351b2218af6cf568 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Tue, 26 Feb 2019 19:18:35 +0100 Subject: [PATCH] chore: remove unneeded deps License: MIT Signed-off-by: Jacob Heun --- package.json | 6 ++++-- src/index.js | 10 ++++------ src/listener.js | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index fc89f2e..3a32a90 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,10 @@ "description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces", "leadMaintainer": "Jacob Heun ", "main": "src/index.js", + "files": [ + "dist", + "src" + ], "scripts": { "lint": "aegir lint", "test": "aegir test -t node -f test/**/*.js", @@ -45,8 +49,6 @@ "debug": "^4.1.1", "interface-connection": "~0.3.3", "ip-address": "^5.8.9", - "lodash.includes": "^4.3.0", - "lodash.isfunction": "^3.0.9", "mafmt": "^6.0.6", "multiaddr": "^6.0.5", "once": "^1.4.0", diff --git a/src/index.js b/src/index.js index b04c223..0e8215e 100644 --- a/src/index.js +++ b/src/index.js @@ -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') } diff --git a/src/listener.js b/src/listener.js index 30b3076..9576b7b 100644 --- a/src/listener.js +++ b/src/listener.js @@ -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') }