mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-05-12 02:37:12 +00:00
fix: only use a single export (#596)
This commit is contained in:
parent
afdbe3deac
commit
30728753cf
@ -504,14 +504,13 @@ class Libp2p extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Libp2p
|
||||
/**
|
||||
* Like `new Libp2p(options)` except it will create a `PeerInfo`
|
||||
* instance if one is not provided in options.
|
||||
* @param {object} options Libp2p configuration options
|
||||
* @returns {Libp2p}
|
||||
*/
|
||||
module.exports.create = async (options = {}) => {
|
||||
Libp2p.create = async function create (options = {}) {
|
||||
if (options.peerInfo) {
|
||||
return new Libp2p(options)
|
||||
}
|
||||
@ -521,3 +520,5 @@ module.exports.create = async (options = {}) => {
|
||||
options.peerInfo = peerInfo
|
||||
return new Libp2p(options)
|
||||
}
|
||||
|
||||
module.exports = Libp2p
|
||||
|
Loading…
x
Reference in New Issue
Block a user