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

feat: improve alias options #1

Merged
merged 1 commit into from
Oct 4, 2023
Merged

feat: improve alias options #1

merged 1 commit into from
Oct 4, 2023

Conversation

ivodolenc
Copy link
Member

Type of Change

  • New feature

Request Description

Improves alias detection and updates tests accordingly.

Now the parser scans all the keys and values from the alias object and if they match the current argument, they will be specified in the final array.

Previously, only keys from object alias were scanned.

Alias Options

$ --c value --e
const args = createArgs({
  alias: {
    a: ['b', 'c'], 
    d: ['e', 'f'], 
  },
})

/* Output:
{
    _: [],
    a: 'value',
    b: 'value',
    c: 'value',
    d: true,
    e: true,
    f: true,
}
*/

@ivodolenc ivodolenc added feat New feature test Test-related labels Oct 4, 2023
@ivodolenc ivodolenc merged commit 234a363 into main Oct 4, 2023
@ivodolenc ivodolenc deleted the feat/alias-options branch October 4, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature test Test-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant