is0692vs / is0692vs/settlemate
Improve TypeScript type safety in netBalances with explicit type assertions
Open
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
Assessment
This issue has not been assessed yet.