Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function intersect(poly1, poly2, options) {
options = checkIfOptionsExist(options);
const properties = options.properties || {};
const geom1 = getGeom(poly1);
const geom2 = getGeom(poly2);
const intersection = polygonClipping.intersection(geom1.coordinates, geom2.coordinates);
if (intersection.length === 0) return null;
return multiPolygon(intersection, properties);
}