index.cjs 1001 B

12345678910111213141516171819202122232425262728
  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
  2. var _meta = require('@turf/meta');
  3. var _helpers = require('@turf/helpers');
  4. function explode(geojson) {
  5. const points = [];
  6. if (geojson.type === "FeatureCollection") {
  7. _meta.featureEach.call(void 0, geojson, function(feature) {
  8. _meta.coordEach.call(void 0, feature, function(coord) {
  9. points.push(_helpers.point.call(void 0, coord, feature.properties));
  10. });
  11. });
  12. } else if (geojson.type === "Feature") {
  13. _meta.coordEach.call(void 0, geojson, function(coord) {
  14. points.push(_helpers.point.call(void 0, coord, geojson.properties));
  15. });
  16. } else {
  17. _meta.coordEach.call(void 0, geojson, function(coord) {
  18. points.push(_helpers.point.call(void 0, coord));
  19. });
  20. }
  21. return _helpers.featureCollection.call(void 0, points);
  22. }
  23. var turf_explode_default = explode;
  24. exports.default = turf_explode_default; exports.explode = explode;
  25. //# sourceMappingURL=index.cjs.map