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

wraps all files that rely on browser window or document in a conditional #600

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

berkeleycole
Copy link

Ensures that the library doesn't error out if browser window or document are not available, making it easier to use for people building static sites or using SSR


// No form
form: false
if (typeof window !== 'undefined') {
Copy link
Owner

@MrSwitch MrSwitch Apr 23, 2019

Choose a reason for hiding this comment

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

Not the whole module relies on this.

Copy link
Author

Choose a reason for hiding this comment

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

Would it be better to take this one out then?
I think I saw the reference to window.navigator.userAgent on line 32 and assumed it would throw an error if window wasn't present.

Co-Authored-By: berkeleycole <berkeleycole@users.noreply.github.com>
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