index.cjs 593 B

12345678910111213141516171819
  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
  2. var _distance = require('@turf/distance');
  3. var _meta = require('@turf/meta');
  4. function length(geojson, options = {}) {
  5. return _meta.segmentReduce.call(void 0,
  6. geojson,
  7. (previousValue, segment) => {
  8. const coords = segment.geometry.coordinates;
  9. return previousValue + _distance.distance.call(void 0, coords[0], coords[1], options);
  10. },
  11. 0
  12. );
  13. }
  14. var turf_length_default = length;
  15. exports.default = turf_length_default; exports.length = length;
  16. //# sourceMappingURL=index.cjs.map