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

refactor(cli): cleanup parse_args.ts #4189

Merged
merged 23 commits into from
Feb 11, 2024

Conversation

timreichen
Copy link
Contributor

This PR removes redundant code in parse_args.ts and makes code more readable and possibly improves performance by

  • using a single RegExp for parsing
  • replacing some objects with Map
  • replacing some arrays with Set

The code can still be made more readable. There probably will be more PRs in the future to do so.

@timreichen timreichen requested a review from kt3k as a code owner January 13, 2024 12:22
@github-actions github-actions bot added the cli label Jan 13, 2024
cli/parse_args.ts Outdated Show resolved Hide resolved
cli/parse_args.ts Outdated Show resolved Hide resolved
@iuioiua
Copy link
Contributor

iuioiua commented Feb 3, 2024

A bit is going on here. Can you add your own comments (in GitHub, not in the code), where appropriate, to ease our understanding and reviews?

cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Sorry for the delayed review.

cli/parse_args.ts Show resolved Hide resolved
cli/parse_args.ts Show resolved Hide resolved
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you, Tim.

@iuioiua iuioiua merged commit 8c022c4 into denoland:main Feb 11, 2024
12 checks passed
kt3k added a commit to kt3k/deno_std that referenced this pull request Mar 14, 2024
kt3k added a commit that referenced this pull request Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants