getEventById
181 return event.id;
182 }
183
184 public getEventById(id: string, maxDelayms = 100): Promise<Event> {185 return this.relays.getEventById(id, this.getCurrentRelaysInArray(), maxDelayms);
186 }
187
postNewEvent
158 //
159 // Event Management
160 //
161 public async postNewEvent(ev: Event, returnNip19 = false): Promise<string | undefined> {162 let event: Event = {
163 ...ev,
164 pubkey: this._pubkey,
getCurrentRelaysInArray
151 return this.pubkey;
152 }
153
154 public getCurrentRelaysInArray(): string[] {155 return this.relays.getRelayStatuses().map(([url, _]) => url);
156 }
157
getPubkeyFromExtension
145 return [this.pubkey, this.privkey];
146 }
147
148 public async getPubkeyFromExtension(): Promise<string | null> {149 if (browser && !window.nostr) return null;
150 this.pubkey = await window.nostr.getPublicKey();
151 return this.pubkey;
generateKeys
138 return input;
139 }
140
141 public generateKeys(): string[] {142 const genPriv = generatePrivateKey();
143 this.privkey = genPriv;
144 this.pubkey = getPublicKey(genPriv);
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
function sum(a, b) {
return a + b;
}
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}