Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type declaration #16

Merged
merged 7 commits into from
Jul 22, 2024
Merged

Conversation

Zen-cronic
Copy link
Contributor

Motivation

The current type declaration on DefinitelyTyped of this package does not accurately reflect the function's return type. See here.

Why

The most recent version of this function (as well as the oldest ones) is not designed to return just the boolean type. In the return line, it can either return:

  • false if the first or third operand is false.
  • undefined if the second operand is undefined.
  • whatever is exported from require() of the last operand, given all the previous values are truthy.

@sindresorhus
Copy link
Owner

@Zen-cronic
Copy link
Contributor Author

on it, thanks for letting me know

@Zen-cronic
Copy link
Contributor Author

the builds are failing for nodejs v12 and below after i added the latest version of tsd 0.31.1

@sindresorhus sindresorhus merged commit 9c0f792 into sindresorhus:main Jul 22, 2024
4 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