mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-04-25 14:22:23 +00:00
refactor: use lodash.includes
instead of lodash.contains
As `loadash.contains` is deprecated.
This commit is contained in:
parent
10b35b22f6
commit
49e23f1961
@ -43,7 +43,7 @@
|
||||
"dependencies": {
|
||||
"interface-connection": "0.3.0",
|
||||
"ip-address": "^5.8.0",
|
||||
"lodash.contains": "^2.4.3",
|
||||
"lodash.includes": "^4.3.0",
|
||||
"mafmt": "^2.1.2",
|
||||
"multiaddr": "^2.1.1",
|
||||
"stream-to-pull-stream": "^1.7.0"
|
||||
@ -57,4 +57,4 @@
|
||||
"Stephen Whitmore <stephen.whitmore@gmail.com>",
|
||||
"greenkeeperio-bot <support@greenkeeper.io>"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
const net = require('net')
|
||||
const toPull = require('stream-to-pull-stream')
|
||||
const mafmt = require('mafmt')
|
||||
const contains = require('lodash.contains')
|
||||
const includes = require('lodash.includes')
|
||||
const isFunction = require('lodash.isfunction')
|
||||
const Connection = require('interface-connection').Connection
|
||||
const debug = require('debug')
|
||||
@ -59,7 +59,7 @@ module.exports = class TCP {
|
||||
multiaddrs = [multiaddrs]
|
||||
}
|
||||
return multiaddrs.filter((ma) => {
|
||||
if (contains(ma.protoNames(), 'ipfs')) {
|
||||
if (includes(ma.protoNames(), 'ipfs')) {
|
||||
ma = ma.decapsulate('ipfs')
|
||||
}
|
||||
return mafmt.TCP.matches(ma)
|
||||
|
@ -3,7 +3,7 @@
|
||||
const multiaddr = require('multiaddr')
|
||||
const Connection = require('interface-connection').Connection
|
||||
const os = require('os')
|
||||
const contains = require('lodash.contains')
|
||||
const includes = require('lodash.includes')
|
||||
const net = require('net')
|
||||
const toPull = require('stream-to-pull-stream')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
@ -78,7 +78,7 @@ module.exports = (handler) => {
|
||||
|
||||
listener.listen = (ma, cb) => {
|
||||
listeningAddr = ma
|
||||
if (contains(ma.protoNames(), 'ipfs')) {
|
||||
if (includes(ma.protoNames(), 'ipfs')) {
|
||||
ipfsId = getIpfsId(ma)
|
||||
listeningAddr = ma.decapsulate('ipfs')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user