Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function preprocessStrokes(data, options) {
const strokes = [];
let stroke;
let length;
for (let i = 0; i < data.length; i += 1) {
for (let j = 0; j < data[i].length; j += 1) {
length = Raphael.getTotalLength(data[i][j].path);
stroke = {
char: i,
length,
duration: length * options.step * 1000,
path: data[i][j].path,
groups: data[i][j].groups,
text: data[i][j].text,
object: {
path: null,
text: null,
},
};
strokes.push(stroke);
}
}