is0692vs / is0692vs/settlemate

Improve TypeScript type safety in netBalances with explicit type assertions

Open
#26 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

When spreading the reverse object in netBalances function, TypeScript may not guarantee that reverse matches type T since it comes from a find() that could theoretically return undefined (though the if-block guards it). This risks type safety issues if the generic constraint changes.

Consider explicitly typing or re-constructing the object with known T properties, e.g., result.push({ ...reverse, amount: -diff } as T);

This was identified in Copilot AI review of PR #24.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.