Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
fix: reduce bundle size (#67)
Browse files Browse the repository at this point in the history
* fix: reduce bundle size
  • Loading branch information
hugomrdias authored and vasco-santos committed Jan 9, 2019
1 parent 355ab30 commit 3ff955e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 49 deletions.
34 changes: 0 additions & 34 deletions .npmignore

This file was deleted.

5 changes: 0 additions & 5 deletions gulpfile.js

This file was deleted.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"coverage": "aegir coverage",
"coverage-publish": "aegir coverage --provider coveralls"
},
"files": [
"src",
"dist"
],
"pre-push": [
"lint"
],
Expand All @@ -38,25 +42,25 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-floodsub#readme",
"devDependencies": {
"aegir": "^18.0.2",
"aegir": "^18.0.3",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"chai-spies": "^1.0.0",
"dirty-chai": "^2.0.1",
"libp2p": "~0.24.3",
"libp2p": "~0.24.4",
"libp2p-secio": "~0.11.0",
"libp2p-spdy": "~0.13.1",
"libp2p-tcp": "~0.13.0",
"peer-id": "~0.12.1",
"peer-info": "~0.15.0"
"lodash": "^4.17.11",
"peer-id": "~0.12.2",
"peer-info": "~0.15.1"
},
"dependencies": {
"async": "^2.6.1",
"bs58": "^4.0.1",
"debug": "^4.1.1",
"length-prefixed-stream": "^1.6.0",
"libp2p-crypto": "~0.15.0",
"lodash": "^4.17.11",
"libp2p-crypto": "~0.16.0",
"protons": "^1.0.1",
"pull-pushable": "^2.2.0",
"time-cache": "~0.3.0"
Expand Down
8 changes: 4 additions & 4 deletions src/base.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const EventEmitter = require('events')
const values = require('lodash/values')
const pull = require('pull-stream')
const pull = require('pull-stream/pull')
const empty = require('pull-stream/sources/empty')
const asyncEach = require('async/each')
const debug = require('debug')

Expand Down Expand Up @@ -136,7 +136,7 @@ class BaseProtocol extends EventEmitter {
conn.getPeerInfo((err, peerInfo) => {
if (err) {
this.log.err('Failed to identify incomming conn', err)
return pull(pull.empty(), conn)
return pull(empty(), conn)
}

const idB58Str = peerInfo.id.toB58String()
Expand Down Expand Up @@ -180,7 +180,7 @@ class BaseProtocol extends EventEmitter {
this.libp2p.on('peer:connect', this._dialPeer)

// Dial already connected peers
const peerInfos = values(this.libp2p.peerBook.getAll())
const peerInfos = Object.values(this.libp2p.peerBook.getAll())

asyncEach(peerInfos, (peer, cb) => this._dialPeer(peer, cb), (err) => {
setImmediate(() => {
Expand Down

0 comments on commit 3ff955e

Please sign in to comment.