mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-04-25 15:12:25 +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:
parent
6d7009ba21
commit
1f01fe7745
3
.gitignore
vendored
3
.gitignore
vendored
@ -32,4 +32,7 @@ node_modules
|
|||||||
# Optional REPL history
|
# Optional REPL history
|
||||||
.node_repl_history
|
.node_repl_history
|
||||||
|
|
||||||
|
# Vim editor swap files
|
||||||
|
*.swp
|
||||||
|
|
||||||
dist
|
dist
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
"homepage": "https://github.com/libp2p/js-libp2p-websockets#readme",
|
"homepage": "https://github.com/libp2p/js-libp2p-websockets#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"interface-connection": "^0.3.0",
|
"interface-connection": "^0.3.0",
|
||||||
"lodash.contains": "^2.4.3",
|
"lodash.includes": "^4.3.0",
|
||||||
"mafmt": "^2.1.2",
|
"mafmt": "^2.1.2",
|
||||||
"pull-ws": "^3.2.8"
|
"pull-ws": "^3.2.8"
|
||||||
},
|
},
|
||||||
@ -58,4 +58,4 @@
|
|||||||
"Richard Littauer <richard.littauer@gmail.com>",
|
"Richard Littauer <richard.littauer@gmail.com>",
|
||||||
"greenkeeperio-bot <support@greenkeeper.io>"
|
"greenkeeperio-bot <support@greenkeeper.io>"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const connect = require('pull-ws/client')
|
const connect = require('pull-ws/client')
|
||||||
const mafmt = require('mafmt')
|
const mafmt = require('mafmt')
|
||||||
const contains = require('lodash.contains')
|
const includes = require('lodash.includes')
|
||||||
const Connection = require('interface-connection').Connection
|
const Connection = require('interface-connection').Connection
|
||||||
const debug = require('debug')
|
const debug = require('debug')
|
||||||
const log = debug('libp2p:websockets:dialer')
|
const log = debug('libp2p:websockets:dialer')
|
||||||
@ -51,7 +51,7 @@ module.exports = class WebSockets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return multiaddrs.filter((ma) => {
|
return multiaddrs.filter((ma) => {
|
||||||
if (contains(ma.protoNames(), 'ipfs')) {
|
if (includes(ma.protoNames(), 'ipfs')) {
|
||||||
ma = ma.decapsulate('ipfs')
|
ma = ma.decapsulate('ipfs')
|
||||||
}
|
}
|
||||||
return mafmt.WebSockets.matches(ma)
|
return mafmt.WebSockets.matches(ma)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const Connection = require('interface-connection').Connection
|
const Connection = require('interface-connection').Connection
|
||||||
const contains = require('lodash.contains')
|
const includes = require('lodash.includes')
|
||||||
|
|
||||||
// const IPFS_CODE = 421
|
// const IPFS_CODE = 421
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ module.exports = (options, handler) => {
|
|||||||
cb = cb || (() => {})
|
cb = cb || (() => {})
|
||||||
listeningMultiaddr = ma
|
listeningMultiaddr = ma
|
||||||
|
|
||||||
if (contains(ma.protoNames(), 'ipfs')) {
|
if (includes(ma.protoNames(), 'ipfs')) {
|
||||||
ma = ma.decapsulate('ipfs')
|
ma = ma.decapsulate('ipfs')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user