How to use the svg-tags.includes function in svg-tags

To help you get started, we’ve selected a few svg-tags examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuejs / jsx / packages / babel-plugin-transform-vue-jsx / src / index.js View on Github external
const getTag = (t, path) => {
  const namePath = path.get('name')
  if (t.isJSXIdentifier(namePath)) {
    const name = namePath.get('name').node
    if (path.scope.hasBinding(name) && !htmlTags.includes(name) && !svgTags.includes(name)) {
      return t.identifier(name)
    } else {
      return t.stringLiteral(name)
    }
  }

  /* istanbul ignore else */
  if (t.isJSXMemberExpression(namePath)) {
    return transformJSXMemberExpression(t, namePath)
  }
  /* istanbul ignore next */
  throw new Error(`getTag: ${namePath.type} is not supported`)
}
github vuejs / jsx / packages / babel-sugar-v-model / src / index.js View on Github external
const isComponent = (t, path) => {
  const name = path.get('name')
  if (t.isJSXMemberExpression(name)) {
    return true
  }

  const tag = name.get('name').node

  return !htmlTags.includes(tag) && !svgTags.includes(tag)
}

svg-tags

List of standard SVG tags.

MIT
Latest version published 10 years ago

Package Health Score

65 / 100
Full package analysis

Popular svg-tags functions