refactor: Use uppercase for default attrs import

This commit is contained in:
Cole Bemis 2018-04-04 11:46:37 -07:00 committed by GitHub
parent b22f3b4515
commit d33cb6ecf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import defaultAttrs from '../src/default-attrs.json';
import DEFAULT_ATTRS from '../src/default-attrs.json';
/**
* Build an SVG sprite string containing SVG symbols.
@ -10,7 +10,7 @@ function buildSpriteString(icons) {
.map(icon => toSvgSymbol(icon, icons[icon]))
.join('');
return `<svg xmlns="${defaultAttrs.xmlns}"><defs>${symbols}</defs></svg>`;
return `<svg xmlns="${DEFAULT_ATTRS.xmlns}"><defs>${symbols}</defs></svg>`;
}
/**
@ -20,7 +20,7 @@ function buildSpriteString(icons) {
* @returns {string}
*/
function toSvgSymbol(name, contents) {
return `<symbol id="${name}" viewBox="${defaultAttrs.viewBox}">${
return `<symbol id="${name}" viewBox="${DEFAULT_ATTRS.viewBox}">${
contents
}</symbol>`;
}