Last 12 weeks · 0 commits
4 of 6 standards met
Repository: sindresorhus/is-svg. Description: Check if a string or buffer is SVG Stars: 144, Forks: 20. Primary language: JavaScript. Languages: JavaScript (97.3%), TypeScript (2.7%). License: MIT. Latest release: v6.1.0 (8mo ago). Open PRs: 1, open issues: 0. Last activity: 2w ago. Community health: 85%. Top contributors: sindresorhus, kevva, Borewit, BendingBender, oantoro, SamVerschueren, urbanautomaton, steffenweber, StephanHoyer, kraftner and others.
Extend , to which you can provide, in addition to an XML an . This may be convenient as the SVG may be encoded in multiple ways. Following text encodings automatically detected and supported: UTF8 without a preceding BOM field UTF8 with a preceding BOM field UTF16-LE without a preceding BOM field UTF16-BE without a preceding BOM field UTF16-LE with a preceding BOM field UTF16-BE with a preceding BOM field Build on top of #40, utilizing @file-type/xml, the XML detection plugin for file-type.
Introduces an optional option, to disable XML validation. Disabling the XML validation makes SVG recognition a lot faster, at the cost the SVG XML is not validated. Difference in processing time: Resulting in about ~12× to ~60× times short processing time. ToDo: [x] Needs a unit test covering use cases with validation disabled Code I used to measure performance: Resolves #42 (with the note that the actual degradation in performance as described in that issue, I could not reproduce, yet this is significantly reduce parsing time)