Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return commit.parents.map((parentHash) => {
const parent = this.state.commits.find(({ hash }) => hash === parentHash);
if (!parent) return null;
// Starting point, relative to commit
const origin = this.gitgraph.reverseArrow
? {
x: commitRadius + (parent.x - commit.x),
y: commitRadius + (parent.y - commit.y),
}
: { x: commitRadius, y: commitRadius };
return (
);
});
}
return commit.parents.map((parentHash) => {
const parent = commits.find(({ hash }) => hash === parentHash);
if (!parent) return null;
// Starting point, relative to commit
const origin = gitgraph.reverseArrow
? {
x: commitRadius + (parent.x - commit.x),
y: commitRadius + (parent.y - commit.y),
}
: { x: commitRadius, y: commitRadius };
const path = createPath({
d: arrowSvgPath(gitgraph, parent, commit),
fill: gitgraph.template.arrow.color || "",
});
return createG({ translate: origin, children: [path] });
});
}