Socket
Socket
Sign inDemoInstall

flatten-svg

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flatten-svg - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

21

dist/svg-to-paths.js

@@ -69,2 +69,12 @@ "use strict";

}
function getStroke(shape) {
const explicitStroke = shape.getAttribute('stroke') || shape.style.stroke;
if (explicitStroke) {
return explicitStroke;
}
else if (shape.parentNode) {
return getStroke(shape.parentNode);
}
return null;
}
function flattenSVG(svg, options = {}) {

@@ -74,5 +84,4 @@ const { maxError = 0.1 } = options;

const paths = [];
for (const path of walkSvgShapes(svg)) {
const type = path.nodeName.toLowerCase();
const ctm = path.getCTM();
for (const shape of walkSvgShapes(svg)) {
const ctm = shape.getCTM();
const xf = ctm == null

@@ -86,3 +95,3 @@ ? ([x, y]) => { return [x, y]; }

};
const pathData = path_data_polyfill_1.getPathData(path, { normalize: true });
const pathData = path_data_polyfill_1.getPathData(shape, { normalize: true });
let cur = null;

@@ -96,5 +105,3 @@ let closePoint = null;

points: [cur],
stroke: path.getAttribute('stroke')
// getComputedStyle doesn't seem to work until the JS loop that inserted it is done...
// stroke: path.getComputedStyle(path).stroke
stroke: getStroke(shape),
});

@@ -101,0 +108,0 @@ }

{
"name": "flatten-svg",
"version": "0.1.2",
"version": "0.1.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc