@libp2p/interface-peer-discovery
Advanced tools
Comparing version 1.1.1 to 2.0.0
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterfacePeerDiscovery = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
"use strict";var Libp2PInterfacePeerDiscovery=(()=>{var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var t=(e,o)=>{for(var p in o)i(e,p,{get:o[p],enumerable:!0})},b=(e,o,p,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of n(o))!y.call(e,r)&&r!==p&&i(e,r,{get:()=>o[r],enumerable:!(l=c(o,r))||l.enumerable});return e};var v=e=>b(i({},"__esModule",{value:!0}),e);var u={};t(u,{isPeerDiscovery:()=>m,peerDiscovery:()=>f,symbol:()=>s});var f=Symbol.for("@libp2p/peer-discovery"),s=Symbol.for("@libp2p/peer-discovery");function m(e){return e!=null&&!!e[s]}return v(u);})(); | ||
"use strict";var Libp2PInterfacePeerDiscovery=(()=>{var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var l=(o,e)=>{for(var p in e)c(o,p,{get:e[p],enumerable:!0})},t=(o,e,p,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!b.call(o,r)&&r!==p&&c(o,r,{get:()=>e[r],enumerable:!(i=s(e,r))||i.enumerable});return o};var v=o=>t(c({},"__esModule",{value:!0}),o);var f={};l(f,{peerDiscovery:()=>d});var d=Symbol.for("@libp2p/peer-discovery");return v(f);})(); | ||
return Libp2PInterfacePeerDiscovery})); |
@@ -23,3 +23,2 @@ import type { PeerInfo } from '@libp2p/interface-peer-info'; | ||
export declare const peerDiscovery: unique symbol; | ||
export declare const symbol: unique symbol; | ||
export interface PeerDiscoveryEvents { | ||
@@ -29,12 +28,3 @@ 'peer': CustomEvent<PeerInfo>; | ||
export interface PeerDiscovery extends EventEmitter<PeerDiscoveryEvents> { | ||
/** | ||
* Used to identify the peer discovery mechanism | ||
*/ | ||
[Symbol.toStringTag]: string; | ||
/** | ||
* Used by the isPeerDiscovery function | ||
*/ | ||
[symbol]: true; | ||
} | ||
export declare function isPeerDiscovery(other: any): other is PeerDiscovery; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -21,6 +21,2 @@ /** | ||
export const peerDiscovery = Symbol.for('@libp2p/peer-discovery'); | ||
export const symbol = Symbol.for('@libp2p/peer-discovery'); | ||
export function isPeerDiscovery(other) { | ||
return other != null && Boolean(other[symbol]); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"PeerDiscovery": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_dht._internal_.PeerDiscovery.html", | ||
"PeerDiscoveryEvents": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_dht._internal_.PeerDiscoveryEvents.html", | ||
"peerDiscovery": "https://libp2p.github.io/js-libp2p-interfaces/variables/_libp2p_interface_peer_discovery.peerDiscovery-1.html", | ||
"symbol": "https://libp2p.github.io/js-libp2p-interfaces/variables/_libp2p_interface_peer_discovery.symbol.html", | ||
"isPeerDiscovery": "https://libp2p.github.io/js-libp2p-interfaces/functions/_libp2p_interface_peer_discovery.isPeerDiscovery.html" | ||
"peerDiscovery": "https://libp2p.github.io/js-libp2p-interfaces/variables/_libp2p_interface_peer_discovery.peerDiscovery-1.html" | ||
} |
{ | ||
"name": "@libp2p/interface-peer-discovery", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"description": "Peer Discovery interface for libp2p", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -25,4 +25,2 @@ import type { PeerInfo } from '@libp2p/interface-peer-info' | ||
export const symbol = Symbol.for('@libp2p/peer-discovery') | ||
export interface PeerDiscoveryEvents { | ||
@@ -32,16 +30,2 @@ 'peer': CustomEvent<PeerInfo> | ||
export interface PeerDiscovery extends EventEmitter<PeerDiscoveryEvents> { | ||
/** | ||
* Used to identify the peer discovery mechanism | ||
*/ | ||
[Symbol.toStringTag]: string | ||
/** | ||
* Used by the isPeerDiscovery function | ||
*/ | ||
[symbol]: true | ||
} | ||
export function isPeerDiscovery (other: any): other is PeerDiscovery { | ||
return other != null && Boolean(other[symbol]) | ||
} | ||
export interface PeerDiscovery extends EventEmitter<PeerDiscoveryEvents> {} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
11860
82