Skip to content

Deprecate sum in favor of Math.sumPrecise#21

Merged
edouardmisset merged 3 commits into
mainfrom
copilot/add-deprecation-warning-sum-function
May 1, 2026
Merged

Deprecate sum in favor of Math.sumPrecise#21
edouardmisset merged 3 commits into
mainfrom
copilot/add-deprecation-warning-sum-function

Conversation

Copilot AI commented Apr 30, 2026

Copy link
Copy Markdown
Contributor
  • Add @deprecated JSDoc tag to sum function in math/sum.ts with migration note pointing to Math.sumPrecise
  • Mark migration code example as typescript ignore to avoid TS2339 type error (Math.sumPrecise is Baseline 2026 and not yet in TypeScript's lib definitions)

@codacy-production

codacy-production Bot commented Apr 30, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage ∅ diff coverage · +0.00% coverage variation

Metric Results
Coverage variation +0.00% coverage variation (-1.00%)
Diff coverage diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (88f8a3b) Report Missing Report Missing Report Missing
Head commit (a900d9c) 1044 (+0) 1001 (+0) 95.88% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#21) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

…sumPrecise

Agent-Logs-Url: https://github.com/edouardmisset/utils/sessions/8033044a-0e9d-49fd-a415-598c379d5dc5

Co-authored-by: edouardmisset <63284636+edouardmisset@users.noreply.github.com>
Copilot AI changed the title [WIP] Add deprecation warning to sum function in favor of Math.sumPrecise Deprecate sum in favor of Math.sumPrecise Apr 30, 2026
Copilot AI requested a review from edouardmisset April 30, 2026 21:15
@edouardmisset

Copy link
Copy Markdown
Owner

@copilot I get an error when I run: deno task check.

TS2339 [ERROR]: Property 'sumPrecise' does not exist on type 'Math'.
assertEquals(Math.sumPrecise([
~~~~~~~~~~
at file:///Users/edouard/Documents/code/me/utils/math/sum.ts$9-14.ts:3:19

error: Type checking failed.

I know Math.sumPrecise is Baseline 2026 newly available.
Why do I get a typescript error ?
How can I resolve it ?

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot I get an error when I run: deno task check.

TS2339 [ERROR]: Property 'sumPrecise' does not exist on type 'Math'....

Math.sumPrecise is Baseline 2026 and TypeScript's built-in lib definitions don't include it yet, so the doc example was being type-checked and failing.

Fixed in a900d9c by changing the migration code block annotation from ```typescript to ```typescript ignore — the same pattern already used in function/get-env.ts for APIs not yet reflected in TypeScript's types. This tells Deno's doc runner to skip type-checking that block while keeping it visible in documentation.

Copilot AI requested a review from edouardmisset May 1, 2026 10:42
@edouardmisset edouardmisset marked this pull request as ready for review May 1, 2026 11:11
@edouardmisset edouardmisset merged commit 1ee773b into main May 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add deprecation warning tu the sum function in favor of Math.sumPrecise

2 participants