From e2ed9ed1847b456d90f901f6e5bc8db11f8cb94a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 15 Jan 2023 02:58:50 -0500 Subject: [PATCH] *Update dist --- dist/index.d.ts | 4 ++-- dist/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 36654a3..62aa0a2 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -3,10 +3,10 @@ export interface Peer { host: string; port: number; } -export type PeerSource = (pubkey: Buffer) => Promise; +export type PeerSource = (pubkey: Buffer, options?: any) => Promise; export declare class PeerDiscovery { private _sources; registerSource(name: string, source: PeerSource): boolean; removeSource(name: string): boolean; - discover(pubkey: string | Buffer): Promise; + discover(pubkey: string | Buffer, options?: {}): Promise; } diff --git a/dist/index.js b/dist/index.js index 6b881dc..f199920 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21,12 +21,12 @@ class PeerDiscovery { this._sources.delete(name); return true; } - async discover(pubkey) { + async discover(pubkey, options = {}) { if (!b4a_1.default.isBuffer(pubkey)) { pubkey = b4a_1.default.from(pubkey, "hex"); } for (const source of this._sources.values()) { - const result = await source(pubkey); + const result = await source(pubkey, options); if (result) { return result; }