Skip to content

Commit e4ac6f1

Browse files
🧹 [Code Health] Remove unnecessary ts-ignore by typing fetchBody as Record (#540)
🎯 What: Removed the ts-ignore comment above delete fetchBody.buildTime by explicitly typing the fetchBody object as Record<string, any>. 💡 Why: This makes the code cleaner and leverages TypeScript's type system to allow deleting properties legitimately, preventing the suppression of potentially useful type-checks. ✅ Verification: Ran tests via bun test src/ which all passed successfully. The TypeScript code is valid. ✨ Result: Improved readability and type safety in src/client.ts by removing a compiler directive. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: sunnylqm <615282+sunnylqm@users.noreply.github.com>
1 parent f432044 commit e4ac6f1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎src/client.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,14 @@ export class Pushy {
366366
return result;
367367
}
368368
this.lastChecking = now;
369-
const fetchBody = {
369+
const fetchBody: Record<string, any> = {
370370
packageVersion: this.options.overridePackageVersion || packageVersion,
371371
hash: currentVersion,
372372
buildTime,
373373
cInfo,
374374
...extra,
375375
};
376376
if (__DEV__) {
377-
// @ts-ignore
378377
delete fetchBody.buildTime;
379378
}
380379
const stringifyBody = JSON.stringify(fetchBody);

0 commit comments

Comments
 (0)