gis-common 1.0.15 → 1.0.17

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.
@@ -717,22 +717,22 @@ Array.prototype.clear = function () {
717
717
 
718
718
  var exp = new Date();
719
719
  exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
720
- document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
720
+ document.cookie = name + '=' + escape(value) + ';expires=' + exp.toGMTString();
721
721
  },
722
722
  remove: function remove(name) {
723
723
  var exp = new Date();
724
724
  exp.setTime(exp.getTime() - 1);
725
- var cval = getCookie(name);
725
+ var cval = this.get(name);
726
726
  if (cval != null) {
727
- document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
727
+ document.cookie = name + '=' + cval + ';expires=' + exp.toGMTString();
728
728
  }
729
729
  },
730
730
  get: function get(name) {
731
- var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
731
+ var arr = document.cookie.match(new RegExp('(^| )' + name + '=([^;]*)(;|$)'));
732
732
  if (arr != null) {
733
733
  return arr[2];
734
734
  } else {
735
- return "";
735
+ return '';
736
736
  }
737
737
  }
738
738
  });
@@ -1494,6 +1494,26 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
1494
1494
  });
1495
1495
  // CONCATENATED MODULE: ./src/utils/StringUtils.js
1496
1496
 
1497
+ /**
1498
+ * 获取字节长度
1499
+ */
1500
+ String.prototype.bLength = function () {
1501
+ return this.replace(/[\u0391-\uFFE5]/g, 'aa').length;
1502
+ };
1503
+ String.prototype.subStringByte = function (n) {
1504
+ var r = /[^\x00-\xff]/g;
1505
+ if (this.replace(r, 'mm').length <= n) {
1506
+ return this;
1507
+ }
1508
+ var m = Math.floor(n / 2);
1509
+ for (var i = m; i < this.length; i++) {
1510
+ var sub = this.substring(0, i);
1511
+ if (sub.replace(r, 'mm').length >= n) {
1512
+ return sub;
1513
+ }
1514
+ }
1515
+ return this;
1516
+ };
1497
1517
  /* harmony default export */ var StringUtils = ({
1498
1518
  /**
1499
1519
  * 常用正则验证
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "gis-common",
3
3
  "description": "gis-common",
4
4
  "main": "dist/resource.min.js",
5
- "version": "1.0.15",
5
+ "version": "1.0.17",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,