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

better checking mac and global regex for userAgent #7

Closed
wants to merge 2 commits into from

Conversation

roeib
Copy link

@roeib roeib commented Jan 11, 2023

better checking mac and global regex for userAgent

better checking mac and global regex for userAgent
Copy link
Owner

@bendrucker bendrucker left a comment

Choose a reason for hiding this comment

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

Based on what was submitted, I have to assume this is just changing things for the sake of it, in which case I'm not inclined to accept it.

If this is fixing a bug, add appropriate test coverage and then we can discuss the implementation.

I'm adding tests back for PRs, note that these changes break the tests.

@@ -3,5 +3,5 @@
var navigator = require('global/window').navigator

module.exports = typeof navigator !== 'undefined' &&
Copy link
Owner

Choose a reason for hiding this comment

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

The regular expression is flagged as case insensitive (/i). Fine with lowercasing the input to avoid the need for a flag but it should be one or the other.

Copy link
Owner

Choose a reason for hiding this comment

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

Note the use of global/window to access navigator, which is then used in tests. Replacing this with window is not correct.

@bendrucker
Copy link
Owner

Closing due to non-response, feel free to address my comments and pick this back up at any time if you'd like.

@bendrucker bendrucker closed this Mar 22, 2023
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