@dra2020/baseclient 1.0.37 → 1.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5973,7 +5973,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
5973
5973
  return result;
5974
5974
  };
5975
5975
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5976
- exports.polyRewindRings = exports.featureRewind = exports.polyTransform = exports.npoints = exports.polyDescribe = exports.polyCompactness = exports.makeConvexHullMonotoneChain2D = exports.polyConvexHull = exports.polyToExteriorPoints = exports.polyFromCircle = exports.polyToPolsbyPopperCircle = exports.polyToCircle = exports.Circle = exports.polyPerimeter = exports.polyDiameter = exports.polyArea = exports.polyNull = exports.polyNormalize = exports.polySimpleArea = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
5976
+ exports.polyBadCoordinates = exports.polyRewindRings = exports.featureRewind = exports.polyTransform = exports.npoints = exports.polyDescribe = exports.polyCompactness = exports.makeConvexHullMonotoneChain2D = exports.polyConvexHull = exports.polyToExteriorPoints = exports.polyFromCircle = exports.polyToPolsbyPopperCircle = exports.polyToCircle = exports.Circle = exports.polyPerimeter = exports.polyDiameter = exports.polyArea = exports.polyNull = exports.polyNormalize = exports.polySimpleArea = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
5977
5977
  const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
5978
5978
  const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
5979
5979
  const graham_scan_1 = __webpack_require__(/*! ./graham-scan */ "./lib/poly/graham-scan.ts");
@@ -6509,6 +6509,7 @@ function featureRewind(poly) {
6509
6509
  closePoly(poly.geometry.coordinates);
6510
6510
  else if (d === 5)
6511
6511
  poly.geometry.coordinates.forEach(closePoly);
6512
+ poly.geometry.type = d === 4 ? 'Polygon' : 'MultiPolygon';
6512
6513
  }
6513
6514
  return poly;
6514
6515
  }
@@ -6577,6 +6578,28 @@ exports.polyRewindRings = polyRewindRings;
6577
6578
  function twoTimesArea(x2, x1, y2, y1) {
6578
6579
  return (x2 - x1) * (y2 + y1);
6579
6580
  }
6581
+ function badCoord(c) {
6582
+ return isNaN(c) || c > 360 || c < -360;
6583
+ }
6584
+ function polyBadCoordinates(f) {
6585
+ if (f.type === 'FeatureCollection' && f.features) {
6586
+ for (let i = 0; i < f.features.length; i++)
6587
+ if (polyBadCoordinates(f.features[i]))
6588
+ return true;
6589
+ return false;
6590
+ }
6591
+ let pp = polyNormalize(f);
6592
+ let bad = false;
6593
+ if (pp) {
6594
+ PP.polyPackEachPoint(pp, (b, iPoly, iRing, iOffset) => {
6595
+ if (bad)
6596
+ return;
6597
+ bad = badCoord(b[iOffset]) || badCoord(b[iOffset + 1]);
6598
+ });
6599
+ }
6600
+ return bad;
6601
+ }
6602
+ exports.polyBadCoordinates = polyBadCoordinates;
6580
6603
 
6581
6604
 
6582
6605
  /***/ }),
@@ -9960,6 +9983,8 @@ exports.partialEqual = partialEqual;
9960
9983
  function exactEqual(o1, o2, options) {
9961
9984
  if (o1 === o2)
9962
9985
  return true;
9986
+ if (options && options.epsilon && typeof o1 === 'number' && typeof o2 === 'number' && Math.abs(o1 - o2) < options.epsilon)
9987
+ return true;
9963
9988
  if (options && options.emptyStringIsNull)
9964
9989
  if ((o1 == null && o2 == '') || (o2 == null && o1 == ''))
9965
9990
  return true;