index.js 450 B

1234567891011121314151617
  1. // index.ts
  2. import { flattenEach } from "@turf/meta";
  3. import { featureCollection } from "@turf/helpers";
  4. function flatten(geojson) {
  5. if (!geojson) throw new Error("geojson is required");
  6. var results = [];
  7. flattenEach(geojson, function(feature) {
  8. results.push(feature);
  9. });
  10. return featureCollection(results);
  11. }
  12. var turf_flatten_default = flatten;
  13. export {
  14. turf_flatten_default as default,
  15. flatten
  16. };
  17. //# sourceMappingURL=index.js.map