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(benchmark): Adds sanitiseVersion function #340

Open
wants to merge 2 commits into
base: issue-335
Choose a base branch
from

Conversation

mfdebian
Copy link
Collaborator

@mfdebian mfdebian commented Dec 9, 2024

This PR adds a minimal sanitization for passing a version command line argument to the benchmark suite.

As it is now users get a random error back (SyntaxError: Unexpected identifier 'find') when passing a unexpected/malformed version argument.

With this change this added function throws an error when it doesn't receive the RegExp we're expecting as an argument, including a little bit more information.

The second commit only changes a variable's name; feel free to trim it. 😊

This PR also replaces #337 since I had included commits that were not supposed to be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant