Skip to content

fix: preserve falsy timeout info - #2085

Open
jakezwang wants to merge 1 commit into
caolan:masterfrom
jakezwang:fix/timeout-falsy-info
Open

jakezwang wants to merge 1 commit into
caolan:masterfrom
jakezwang:fix/timeout-falsy-info

Conversation

@jakezwang

Copy link
Copy Markdown

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).

This branch has not been deployed

No deployments
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.

1 participant