Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: faster detection for large files that are not SVGs
If you pass in a large Buffer, the `validate` method on the SVG type can take an extremely long time because it converts the entire Buffer into a string. An easy fix that should take care of this 99% of the time, is to first check for the presence of the bytes used to represent `<svg`. In my testing this is at least 100x faster than converting a large Buffer to a string.
- Loading branch information