Use lodash.includes instead of the deprecated lodash.contains (#39)

* .gitignore Vim swp files

* Use lodash.includes instead of the deprecated lodash.contains
This commit is contained in:
Chris Campbell
2016-12-15 21:06:54 -08:00
committed by David Dias
parent 6d7009ba21
commit 1f01fe7745
4 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
const connect = require('pull-ws/client')
const mafmt = require('mafmt')
const contains = require('lodash.contains')
const includes = require('lodash.includes')
const Connection = require('interface-connection').Connection
const debug = require('debug')
const log = debug('libp2p:websockets:dialer')
@ -51,7 +51,7 @@ module.exports = class WebSockets {
}
return multiaddrs.filter((ma) => {
if (contains(ma.protoNames(), 'ipfs')) {
if (includes(ma.protoNames(), 'ipfs')) {
ma = ma.decapsulate('ipfs')
}
return mafmt.WebSockets.matches(ma)

View File

@ -1,7 +1,7 @@
'use strict'
const Connection = require('interface-connection').Connection
const contains = require('lodash.contains')
const includes = require('lodash.includes')
// const IPFS_CODE = 421
@ -28,7 +28,7 @@ module.exports = (options, handler) => {
cb = cb || (() => {})
listeningMultiaddr = ma
if (contains(ma.protoNames(), 'ipfs')) {
if (includes(ma.protoNames(), 'ipfs')) {
ma = ma.decapsulate('ipfs')
}