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

Allow readonly array as parameter to .aliases(), .parse(), .parseAsync() #1669

Merged
merged 2 commits into from Jan 3, 2022

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Jan 2, 2022

Pull Request

Problem

readonly array cannot be passed directly as parameter to .aliases(), .parse(), or .parseAsync().

Work-around: make a modifiable copy, like by calling .slice().

Following pattern used in #1667 for .choices().

Solution

No implementation changes needed, just declaration and tests.

  • add readonly to TypeScript declaration file
  • add readonly test to TypeScript tests
  • add readonly tests of JavaScript implementation

ChangeLog

  • changed: allow passing readonly string array to .parse()
  • changed: allow passing readonly string array to .parseAsync()
  • changed: allow passing readonly string array to .aliases()

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 Jan 3, 2022
@shadowspawn shadowspawn added this to the Commander v9.0.0 milestone Jan 3, 2022
@shadowspawn shadowspawn merged commit f17ecbd into tj:release/9.x Jan 3, 2022
@shadowspawn shadowspawn deleted the feature/more-readonly branch January 3, 2022 09:28
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Jan 29, 2022
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.

None yet

2 participants