mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-06-24 23:21:41 +00:00
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:
committed by
David Dias
parent
6d7009ba21
commit
1f01fe7745
@ -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)
|
||||
|
@ -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')
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user