Skip to content

fix: preserve falsy timeout info - #2085

Merged
aearly merged 1 commit into
caolan:masterfrom
jakezwang:fix/timeout-falsy-info
Sep 21, 2026
Merged

aearly merged 1 commit into
caolan:masterfrom
jakezwang:fix/timeout-falsy-info

Conversation

@jakezwang

Copy link
Copy Markdown
Contributor

timeout(fn, milliseconds, info) documents info as any value, but the truthiness check drops 0, false, '', and null from the timeout error.

Only omit error.info when the argument is undefined. Add tests for falsy values and for an omitted argument.

Validation: the four falsy-value cases fail before the fix; npm test passes (695 tests and ESLint).

@aearly
aearly merged commit c2ba656 into caolan:master Sep 21, 2026
6 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.

2 participants