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: handle custom parser nested array for multiple flag #568

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

peternhale
Copy link
Contributor

@W-12165862@

@peternhale peternhale requested a review from mshanemc December 6, 2022 20:04
@@ -175,7 +175,7 @@ export type OptionFlagProps = FlagProps & {
multiple?: boolean;
}

export type FlagParser<T, I, P = any> = (input: I, context: any, opts: P & OptionFlag<T>) => Promise<T>
export type FlagParser<T, I, P = any> = (input: I, context: any, opts: P & OptionFlag<T>) => Promise<T | T[]>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add alternative T[] return value (would be the nested array returned by flag.parse)

src/parser/parse.ts Show resolved Hide resolved
@peternhale peternhale merged commit 046445c into main Dec 6, 2022
@peternhale peternhale deleted the phale/nested-array branch December 6, 2022 21:36
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