"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// index.ts var _helpers = require('@turf/helpers'); var _meta = require('@turf/meta'); var _polygonclipping = require('polygon-clipping'); var _polygonclipping2 = _interopRequireDefault(_polygonclipping); function intersect(features, options = {}) { const geoms = []; _meta.geomEach.call(void 0, features, (geom) => { geoms.push(geom.coordinates); }); if (geoms.length < 2) { throw new Error("Must specify at least 2 geometries"); } const intersection = _polygonclipping2.default.intersection( geoms[0], ...geoms.slice(1) ); if (intersection.length === 0) return null; if (intersection.length === 1) return _helpers.polygon.call(void 0, intersection[0], options.properties); return _helpers.multiPolygon.call(void 0, intersection, options.properties); } var turf_intersect_default = intersect; exports.default = turf_intersect_default; exports.intersect = intersect; //# sourceMappingURL=index.cjs.map