Skip to content

feat: improve alias options#1

Merged
ivodolenc merged 1 commit intomainfrom
feat/alias-options
Oct 4, 2023
Merged

feat: improve alias options#1
ivodolenc merged 1 commit intomainfrom
feat/alias-options

Conversation

@ivodolenc
Copy link
Copy Markdown
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