add isProtomux helper
This commit is contained in:
parent
79ce9e21f8
commit
8aff462da3
4
index.js
4
index.js
|
@ -263,6 +263,10 @@ module.exports = class Protomux {
|
||||||
return new this(stream, opts)
|
return new this(stream, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isProtomux (mux) {
|
||||||
|
return typeof mux === 'object' && mux.isProtomux === true
|
||||||
|
}
|
||||||
|
|
||||||
* [Symbol.iterator] () {
|
* [Symbol.iterator] () {
|
||||||
for (const session of this._local) {
|
for (const session of this._local) {
|
||||||
if (session !== null) yield session
|
if (session !== null) yield session
|
||||||
|
|
Reference in New Issue