@f/is-svg

Check whether or not a tag name is an SVG element

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Jan 7, 2016Jan 7, 2016Minified + gzip package size for @f/is-svg in KB

Readme

is-svg

Build status Git tag NPM version Code style

Check whether or not a tag name is an SVG element

Installation

$ npm install @f/is-svg

Usage

var isSvg = require('@f/is-svg')

function createElement (tag) {
  return isSvg(tag)
    ? document.createElementNS(tag, svgNs)
    : document.createElement(tag)
}

API

isSvg(arg)

  • arg -

Returns:

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.