How to use the ember-svg-jar/utils/make-helper function in ember-svg-jar

To help you get started, we’ve selected a few ember-svg-jar 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 ivanvotti / ember-svg-jar / app / helpers / svg-jar.js View on Github external
import makeSVG from 'ember-svg-jar/utils/make-svg';

function getInlineAsset(assetId) {
  try {
    /* eslint-disable global-require */
    return require(`ember-svg-jar/inlined/${assetId}`).default;
  } catch (err) {
    return null;
  }
}

export function svgJar(assetId, svgAttrs) {
  return makeSVG(assetId, svgAttrs, getInlineAsset);
}

export default makeHelper(svgJar);

ember-svg-jar

Best way to use SVG images in Ember applications

MIT
Latest version published 2 months ago

Package Health Score

81 / 100
Full package analysis