Skip to content
Snippets Groups Projects
Unverified Commit 46ed6f02 authored by chris48s's avatar chris48s Committed by GitHub
Browse files

improve performance of getIconSize() (#10125)

* load icons once on module load
parent edae8073
No related branches found
No related tags found
No related merge requests found
import SVGPathCommander from 'svg-path-commander'
import loadSimpleIcons from './load-simple-icons.js'
const simpleIcons = loadSimpleIcons()
function svg2base64(svg) {
return `data:image/svg+xml;base64,${Buffer.from(svg.trim()).toString(
'base64',
......@@ -8,8 +10,6 @@ function svg2base64(svg) {
}
function getIconSize(iconKey) {
const simpleIcons = loadSimpleIcons()
if (!(iconKey in simpleIcons)) {
return undefined
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment