Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
for(let [index, command] of pathData.commands.entries()) {
switch(command.type) {
// Move ('M') and line ('L') commands have both X and Y
case SVGPathData.MOVE_TO:
case SVGPathData.LINE_TO:
currentPath.points.push([
command.x,
command.y
]);
break;
// Horizontal line ('H') commands only have X, using previous command's Y
case SVGPathData.HORIZ_LINE_TO:
currentPath.points.push([
command.x,
previousCoords.y
]);
break;
// Vertical line ('V') commands only have Y, using previous command's X
case SVGPathData.VERT_LINE_TO:
currentPath.points.push([
previousCoords.x,
command.y
]);
break;