Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parse(str) {
return new Path(str).abs();
}
export default function applyTransforms ( node, transforms ) {
if ( node.attributes.transform ) {
transforms = transforms.concat( node.attributes.transform );
delete node.attributes.transform;
}
const transformString = transforms.join( ' ' );
if ( node.name === 'path' ) {
node.attributes.d = svgpath( node.attributes.d )
.transform( transformString )
.round( 10 )
.toString();
} else if ( transformString ) {
node.attributes.transform = transformString;
}
}
initPath() {
if(typeof this.path !== 'string' || this.path.length === 0){
throw new Error('d must not be empty')
}
const sobj = svgpath(this.path)
this.realPath = sobj.rotate(this.rotate).scale(this.scale).rel().toString();
}
convertPoint(point) {