Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getPathIntersection(waypoints, reference) {
var intersections = intersectPaths(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
var a = intersections[0],
b = intersections[intersections.length - 1],
idx;
if (!a) {
// no intersection
return null;
}
if (a !== b) {
if (a.segment2 !== b.segment2) {
// we use the bendpoint in between both segments
export function getIntersections(a, b) {
return intersectPaths(a, b);
}