is-svg
Version:
Check if a string is SVG
36 lines (21 loc) • 494 B
Markdown
> Check if a string is [SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics)
```sh
npm install is-svg
```
```js
import isSvg from 'is-svg';
isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>');
//=> true
```
Type: `object`
Type: `boolean`\
Default: `true`
Whether to validate the SVG as proper XML.
Turning this off can improve performance significantly.