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

Simplify addHelpText TypeScript signature and improve typings test #1516

Conversation

shadowspawn
Copy link
Collaborator

Pull Request

Problem

Declaring that .addHelpText() callback may return undefined makes for a messy signature. The intent was to allow a falsey value returned to skip display, by just calling return in callback.

Solution

Restrict to strings. User can easily return empty string to get the falsey behaviour of skipping display.

Improve the typings test of the callback.

ChangeLog

  • TypeScript definition for .addTextHelp() callback no longer allows result of undefined, now just string.

Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label May 9, 2021
@shadowspawn shadowspawn added this to the v8.0.0 milestone May 9, 2021
@shadowspawn shadowspawn merged commit 8b5599e into tj:release/8.x May 9, 2021
@shadowspawn shadowspawn deleted the feature/tweak-typings-for-addHelpText branch May 9, 2021 23:00
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Jun 25, 2021
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