is-svg

WebJar for is-svg

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

is-svg
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

is-svg
WebJar for is-svg
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/is-svg

Download is-svg

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/is-svg/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>is-svg</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/is-svg/
implementation 'org.webjars.npm:is-svg:3.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/is-svg/
implementation ("org.webjars.npm:is-svg:3.0.0")
'org.webjars.npm:is-svg:jar:3.0.0'
<dependency org="org.webjars.npm" name="is-svg" rev="3.0.0">
  <artifact name="is-svg" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='is-svg', version='3.0.0')
)
libraryDependencies += "org.webjars.npm" % "is-svg" % "3.0.0"
[org.webjars.npm/is-svg "3.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : html-comment-regex jar [1.1.0,2)

Project Modules

There are no modules declared in this project.

is-svg

Check if a string or buffer is SVG

Install

$ npm install is-svg

Usage

const isSvg = require('is-svg');

isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>');
//=> true

Edge cases

This module performs a quick-and-dirty check. It's fast, but in certain cases it will give incorrect results.

  • Returns true for an SVG-like string that isn't well-formed or valid: <svg><div></svg>

If you want to make certain that your SVG is valid, try parsing it with libxmljs.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
3.0.0
2.1.0