Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Better to allow 0 for everything else, but switch to 1 for this plugin.
plugin.params.floatPrecision = 1;
} else {
plugin.params.floatPrecision = floatPrecision;
}
}
}
const svg = cloneParsedSvg(parsedSvg);
let svgData;
let previousDataLength;
while (svgData === undefined || svgData.length != previousDataLength) {
previousDataLength = svgData && svgData.length;
plugins(svg, {input: 'string'}, optimisedPluginsData);
svgData = js2svg(svg, {
indent: ' ',
pretty: settings.pretty
}).data;
yield {
data: svgData,
dimensions: getDimensions(svg)
};
}
}
svg2js(svg, parsedSvg => {
if (parsedSvg.error) {
throw Error(parsed.error);
}
const svg = cloneParsedSvg(parsedSvg);
let cleanSvg;
plugins(svg, {input: 'string'}, optimisedPluginsData);
cleanSvg = js2svg(svg, { indent: ' ' }).data;
self.postMessage(cleanSvg);
});
});
svg2js(value, (svg) => {
if (svg.error) {
reject(new Error(normalizeErrorString(svg.error)));
return;
}
plugins(svg, opts);
const jsx = js2svg(svg, {
indent: ' ',
pretty: true,
}).data;
resolve(jsx);
});
});