diff --git a/dist/index.d.ts b/dist/index.d.ts index 696ee7b..13488d4 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -9,5 +9,6 @@ export declare class PeerDiscovery { registerSource(name: string, source: PeerSource): boolean; removeSource(name: string): boolean; removeAllSources(): void; + sourceExists(name: string): boolean; discover(pubkey: string | Buffer, options?: {}): Promise; } diff --git a/dist/index.js b/dist/index.js index 48758de..c45a9c3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -24,6 +24,9 @@ class PeerDiscovery { removeAllSources() { this._sources.clear(); } + sourceExists(name) { + return this._sources.has(name); + } async discover(pubkey, options = {}) { if (!b4a_1.default.isBuffer(pubkey)) { pubkey = b4a_1.default.from(pubkey, "hex");