*Update dist

This commit is contained in:
Derrick Hammer 2023-01-15 03:50:17 -05:00
parent b6469a6a45
commit 038555ac62
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 4 additions and 0 deletions

1
dist/index.d.ts vendored
View File

@ -9,5 +9,6 @@ export declare class PeerDiscovery {
registerSource(name: string, source: PeerSource): boolean; registerSource(name: string, source: PeerSource): boolean;
removeSource(name: string): boolean; removeSource(name: string): boolean;
removeAllSources(): void; removeAllSources(): void;
sourceExists(name: string): boolean;
discover(pubkey: string | Buffer, options?: {}): Promise<Peer | boolean>; discover(pubkey: string | Buffer, options?: {}): Promise<Peer | boolean>;
} }

3
dist/index.js vendored
View File

@ -24,6 +24,9 @@ class PeerDiscovery {
removeAllSources() { removeAllSources() {
this._sources.clear(); this._sources.clear();
} }
sourceExists(name) {
return this._sources.has(name);
}
async discover(pubkey, options = {}) { async discover(pubkey, options = {}) {
if (!b4a_1.default.isBuffer(pubkey)) { if (!b4a_1.default.isBuffer(pubkey)) {
pubkey = b4a_1.default.from(pubkey, "hex"); pubkey = b4a_1.default.from(pubkey, "hex");