Skip to content

Conversation

@tomas-zijdemans
Copy link
Contributor

  • Add NaN input validation (throws TypeError)
  • Fix docs to clarify >= MAX_SAFE_INTEGER boundary
  • Skip AbortSignal.any() overhead for single-signal cases
  • Add test for NaN handling

Benchmarks show ~2.7× faster for the common timeout-only case, ~7× faster when no deadline is needed. The dual-signal path is roughly equivalent.

…rage

- Add NaN input validation with TypeError
- Fix docs: clarify MAX_SAFE_INTEGER boundary behavior
- Refactor to avoid unnecessary AbortSignal.any() when not needed
- Early return original promise when no timeout and no signal
- Add tests for: zero timeout, NaN, custom abort reason, signal priority, MAX_SAFE_INTEGER
@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.18%. Comparing base (13e5527) to head (53f88cd).

Files with missing lines Patch % Lines
async/deadline.ts 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6921   +/-   ##
=======================================
  Coverage   94.17%   94.18%           
=======================================
  Files         584      584           
  Lines       43087    43101   +14     
  Branches     6875     6880    +5     
=======================================
+ Hits        40578    40593   +15     
+ Misses       2457     2456    -1     
  Partials       52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant