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

Default info on SVGO.optimize API #1176

Merged
merged 1 commit into from
Oct 30, 2019
Merged

Default info on SVGO.optimize API #1176

merged 1 commit into from
Oct 30, 2019

Conversation

Cherry
Copy link
Contributor

@Cherry Cherry commented Oct 30, 2019

As per PR #1173, and commit 71c7fe7, passing info to the SVGO.optimize function is no longer optional. Without setting info, the following error is thrown:
Cannot set property 'multipassCount' of undefined

I'm not entirely sure if this was ever meant to be optional, but, it's worked that way up until 1.3.0, and you can find hundreds of examples on GitHub of people using it this way: https://github.com/search?l=JavaScript&q=%22svgo.optimize%22&type=Code

This PR simply sets info to an empty object if it's not set, which enables backwards compatibility with 1.3.0 and other versions, which will save people who use "compatible with" versions in their package.json declarations. If you have a better suggestion for how to solve this, I'm open to it.

Fixes #1174

@arrisar
Copy link

arrisar commented Oct 30, 2019

Thanks for the quick turnaround all! My build system took a break for the day while I waited anxiously for this to be merged 🙇

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.

Issue on React App deployment
3 participants