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

fix: type-safe overwriteCommand #885

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

KuznetsovRoman
Copy link
Member

No description provided.

@KuznetsovRoman KuznetsovRoman force-pushed the fix/kroman512/types/overwriteCommand branch from 62d4aa3 to 3d131b8 Compare March 26, 2024 08:18
Copy link
Member

@shadowusr shadowusr left a comment

Choose a reason for hiding this comment

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

I'm ok with this solution as is.


Thinking out loud, this code shouldn't be at hermione at all. Also, this gives user an illusion of being type-safe, because you can overwrite non-existent commands, which are methods of browser object. When there's just string, you essentially let users know that it's their responsibility to check command name.

Also, I'd have a look at the SetParameterType helper in type-fest, looks like it does exactly what we need — changes one parameter type, while keeping all other things intact.

@KuznetsovRoman
Copy link
Member Author

type-fest

While we have it in devDeps only, it won't work unless user has it.

@KuznetsovRoman KuznetsovRoman force-pushed the fix/kroman512/types/overwriteCommand branch from 7e95137 to ef75066 Compare March 26, 2024 12:22
@KuznetsovRoman KuznetsovRoman merged commit b10d17b into master Mar 26, 2024
2 checks passed
@KuznetsovRoman KuznetsovRoman deleted the fix/kroman512/types/overwriteCommand branch March 26, 2024 12:24
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.

None yet

2 participants