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

Commit

Permalink
fix: reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias authored and jacobheun committed Jan 10, 2019
1 parent c26ae32 commit 68ae2c3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 122 deletions.
35 changes: 0 additions & 35 deletions .npmignore

This file was deleted.

32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

29 changes: 0 additions & 29 deletions appveyor.yml

This file was deleted.

15 changes: 0 additions & 15 deletions circle.yml

This file was deleted.

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"browser": {
"src/listener": "./src/listener.browser.js"
},
"files": [
"src",
"dist"
],
"pre-push": [
"lint",
"test"
Expand All @@ -37,18 +41,17 @@
"homepage": "https://github.com/libp2p/js-libp2p-websockets#readme",
"dependencies": {
"class-is": "^1.1.0",
"debug": "^4.1.0",
"interface-connection": "~0.3.2",
"lodash.includes": "^4.3.0",
"mafmt": "^6.0.0",
"pull-ws": "^3.3.1"
"mafmt": "multiformats/js-mafmt#fix/bundle-size",
"pull-ws": "hugomrdias/pull-ws#fix/bundle-size"
},
"devDependencies": {
"aegir": "^13.1.0",
"aegir": "github:ipfs/aegir#feat/make-exp-build-test-default",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"gulp": "^3.9.1",
"interface-transport": "~0.3.6",
"multiaddr": "^5.0.0",
"multiaddr": "^6.0.0",
"pull-goodbye": "0.0.2",
"pull-stream": "^3.6.7"
},
Expand Down
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const connect = require('pull-ws/client')
const mafmt = require('mafmt')
const withIs = require('class-is')
const includes = require('lodash.includes')
const Connection = require('interface-connection').Connection

const maToUrl = require('./ma-to-url')
Expand Down Expand Up @@ -52,11 +51,11 @@ class WebSockets {
}

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')
}

Expand Down
3 changes: 1 addition & 2 deletions src/listener.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

const Connection = require('interface-connection').Connection
const includes = require('lodash.includes')
const multiaddr = require('multiaddr')
const os = require('os')

Expand All @@ -26,7 +25,7 @@ module.exports = (options, handler) => {
callback = callback || noop
listeningMultiaddr = ma

if (includes(ma.protoNames(), 'ipfs')) {
if (ma.protoNames().includes('ipfs')) {
ma = ma.decapsulate('ipfs')
}

Expand Down

0 comments on commit 68ae2c3

Please sign in to comment.