index.cjs 1.0 KB

1234567891011121314151617181920212223
  1. "use strict";Object.defineProperty(exports, "__esModule", {value: true});// index.ts
  2. var _geojsonequalityts = require('geojson-equality-ts');
  3. var _cleancoords = require('@turf/clean-coords');
  4. var _invariant = require('@turf/invariant');
  5. function booleanEqual(feature1, feature2, options = {}) {
  6. let precision = options.precision;
  7. precision = precision === void 0 || precision === null || isNaN(precision) ? 6 : precision;
  8. if (typeof precision !== "number" || !(precision >= 0)) {
  9. throw new Error("precision must be a positive number");
  10. }
  11. const type1 = _invariant.getGeom.call(void 0, feature1).type;
  12. const type2 = _invariant.getGeom.call(void 0, feature2).type;
  13. if (type1 !== type2) return false;
  14. return _geojsonequalityts.geojsonEquality.call(void 0, _cleancoords.cleanCoords.call(void 0, feature1), _cleancoords.cleanCoords.call(void 0, feature2), {
  15. precision
  16. });
  17. }
  18. var turf_boolean_equal_default = booleanEqual;
  19. exports.booleanEqual = booleanEqual; exports.default = turf_boolean_equal_default;
  20. //# sourceMappingURL=index.cjs.map