index.js 673 B

12345678910111213141516171819202122232425
  1. // index.ts
  2. import { booleanDisjoint } from "@turf/boolean-disjoint";
  3. import { flattenEach } from "@turf/meta";
  4. function booleanIntersects(feature1, feature2, {
  5. ignoreSelfIntersections = true
  6. } = {}) {
  7. let bool = false;
  8. flattenEach(feature1, (flatten1) => {
  9. flattenEach(feature2, (flatten2) => {
  10. if (bool === true) {
  11. return true;
  12. }
  13. bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry, {
  14. ignoreSelfIntersections
  15. });
  16. });
  17. });
  18. return bool;
  19. }
  20. var turf_boolean_intersects_default = booleanIntersects;
  21. export {
  22. booleanIntersects,
  23. turf_boolean_intersects_default as default
  24. };
  25. //# sourceMappingURL=index.js.map