Skip to content

Conversation

@bbrewington
Copy link

Summary

This PR addresses two minor issues:

  1. Fix url.parse() deprecation warning

    Node.js shows a deprecation warning when running the project:
    [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors...

    This originates from the proxy-from-env dependency. Since we can't modify the dependency directly, this PR adds a patch-package patch that replaces the deprecated url.parse() with the WHATWG URL API (new URL()).

    Relevant files changed:

    • package-lock.json
    • package.json
    • patches/proxy-from-env+1.1.0.patch
  2. Fix floating-point test precision in calculateRank.test.js

    The "beginner user gets B- rank" test fails with a 1 ULP (Unit in Last Place) difference:

    • Expected: 65.02918514848255
    • Actual: 65.02918514848257

    Root cause analysis: The test expectation was computed using a mathematically equivalent but floating-point-different formula than what the actual code produces:

    Expression Result
    Code: (1 - sum/12) * 100 65.02918514848257
    Test expectation: 100 - 100*sum/12 65.02918514848255

    These are algebraically identical but produce different IEEE 754 results due to different intermediate rounding. Both values are correct to ~14 significant digits. The fix updates the expected value to match what the code actually computes.

    Relevant files changed:

    • tests/calculateRank.test.js

Test Results

  • All 242 tests pass
  • ESLint passes
  • Prettier check passes

bbrewington and others added 2 commits January 3, 2026 13:28
The "beginner user gets B- rank" test was failing with a 1 ULP
(Unit in Last Place) difference in the percentile value.

Root cause: The test expected value (65.02918514848255) was computed
using a mathematically equivalent but floating-point-different formula
than what the actual code produces.

The code computes: (1 - sum/12) * 100 → 65.02918514848257
But the expected value came from: 100 - 100*sum/12 → 65.02918514848255

These are algebraically identical but produce different IEEE 754
results due to different intermediate rounding. Both values are
correct to ~14 significant digits.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Node.js shows a deprecation warning for url.parse():
"[DEP0169] DeprecationWarning: url.parse() behavior is not standardized
and prone to errors..."

This adds a patch-package patch to [email protected] that replaces
the deprecated url.parse() with the WHATWG URL API (new URL()).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@bbrewington bbrewington requested a review from qwerty541 as a code owner January 3, 2026 18:48
@vercel
Copy link

vercel bot commented Jan 3, 2026

@bbrewington is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jan 3, 2026
@bbrewington bbrewington changed the title Fix/deprecation warning and test precision fix: deprecation warning and test precision Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant