You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 Add docstrings to claude/issue-27-20250629_142659
Docstrings generation was requested by @jaspermayone.
* #112 (comment)
The following files were modified:
* `src/func/domain/domain.ts`
* `src/func/domain/parseData.ts`
Copy file name to clipboardExpand all lines: src/func/domain/domain.ts
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,14 @@ import { db } from "src/utils/db";
18
18
import{warn}from"src/utils/logger";
19
19
20
20
/**
21
-
* Helper function to safely call an external API service with quota error handling
22
-
* @param serviceName - Name of the service for logging
23
-
* @param serviceCall - Promise function to call the service
24
-
* @param domain - Domain being checked (for logging)
25
-
* @returns Service response or null if failed
21
+
* Executes an external service call for a domain, returning the result or `null` if an error occurs.
22
+
*
23
+
* Handles quota and rate limit errors gracefully by logging a warning and skipping the service check, allowing the overall process to continue without interruption.
24
+
*
25
+
* @param serviceName - The name of the external service being called, used for logging context.
26
+
* @param serviceCall - A function that returns a Promise for the external service request.
27
+
* @param domain - The domain being checked, included in log messages for context.
28
+
* @returns The service response if successful, or `null` if an error or quota limit is encountered.
26
29
*/
27
30
asyncfunctionsafeServiceCall(
28
31
serviceName: string,
@@ -57,9 +60,12 @@ async function safeServiceCall(
57
60
}
58
61
59
62
/**
60
-
* Check the domain against all the services
61
-
* @param domain - Domain to check
62
-
* @returns void
63
+
* Performs security and reputation checks on a domain using multiple external services.
64
+
*
65
+
* Calls a set of external services to assess the given domain, handling errors gracefully for each service. Ensures the domain is recorded in the database if not already present.
66
+
*
67
+
* @param domain - The domain name to check
68
+
* @returns An object containing the results from each service, with `null` for any service that failed or was rate-limited
0 commit comments