gis-common 2.2.7 → 2.2.8

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.
@@ -129,6 +129,7 @@ __webpack_require__.d(__webpack_exports__, "HashMap", function() { return /* ree
129
129
  __webpack_require__.d(__webpack_exports__, "WebSocketClient", function() { return /* reexport */ core_WebSocketClient; });
130
130
  __webpack_require__.d(__webpack_exports__, "WebStorage", function() { return /* reexport */ core_WebStorage; });
131
131
  __webpack_require__.d(__webpack_exports__, "DevicePixelRatio", function() { return /* reexport */ core_DevicePixelRatio; });
132
+ __webpack_require__.d(__webpack_exports__, "Assert", function() { return /* reexport */ Assert; });
132
133
 
133
134
  // CONCATENATED MODULE: ./src/utils/AnimateUtils.js
134
135
  /* harmony default export */ var AnimateUtils = ({
@@ -2687,6 +2688,110 @@ var DevicePixelRatio = function () {
2687
2688
  }();
2688
2689
 
2689
2690
  /* harmony default export */ var core_DevicePixelRatio = (DevicePixelRatio);
2691
+ // CONCATENATED MODULE: ./src/core/Assert.js
2692
+
2693
+
2694
+
2695
+
2696
+ /* harmony default export */ var Assert = ({
2697
+ notNull: function notNull(data) {
2698
+ if (CommUtils.isEmpty()) {
2699
+ throw Error('不能为空:>>>' + data);
2700
+ }
2701
+ },
2702
+ legalLnglat: function legalLnglat(lng, lat) {
2703
+ if (!GeoUtils.isLnglat(lng, lat)) {
2704
+ throw Error(ErrorTypeConstant.COORDINATE_ERROR);
2705
+ }
2706
+ },
2707
+
2708
+ verify: {
2709
+ array: function array(data) {
2710
+ if (CommUtils.getDataType(data) !== 'Array') {
2711
+ throw Error(ErrorTypeConstant.PARAMETER_ERROR_ARRAY + ':>>>' + data);
2712
+ }
2713
+ },
2714
+ function: function _function(data) {
2715
+ if (CommUtils.getDataType(data) !== 'Function') {
2716
+ throw Error(ErrorTypeConstant.PARAMETER_ERROR_FUNCTION + ':>>>' + data);
2717
+ }
2718
+ },
2719
+ object: function object(data) {
2720
+ if (CommUtils.getDataType(data) !== 'Object') {
2721
+ throw Error(ErrorTypeConstant.PARAMETER_ERROR_OBJECT + ':>>>' + data);
2722
+ }
2723
+ }
2724
+ },
2725
+ legalJSON: function legalJSON(data) {
2726
+ try {
2727
+ JSON.parse(data);
2728
+ } catch (err) {
2729
+ throw Error(ErrorTypeConstant.JSON_PARSE_ERROR + ':>>>' + data);
2730
+ }
2731
+ },
2732
+ legalData: function legalData(data, type) {
2733
+ var bool = StringUtils.checkStr(data, type);
2734
+ var typename = '';
2735
+ switch (type) {
2736
+ case 'phone':
2737
+ typename = '电话';
2738
+ break;
2739
+ case 'tel':
2740
+ typename = '座机';
2741
+ break;
2742
+ case 'card':
2743
+ typename = '身份证';
2744
+ break;
2745
+ case 'pwd':
2746
+ typename = '密码';
2747
+ break;
2748
+ case 'postal':
2749
+ typename = '邮政编码';
2750
+ break;
2751
+ case 'QQ':
2752
+ typename = 'QQ';
2753
+ break;
2754
+ case 'email':
2755
+ typename = '邮箱';
2756
+ break;
2757
+ case 'money':
2758
+ typename = '金额';
2759
+ break;
2760
+ case 'URL':
2761
+ typename = '网址';
2762
+ break;
2763
+ case 'IP':
2764
+ typename = 'IP';
2765
+ break;
2766
+ case 'date':
2767
+ typename = '日期时间';
2768
+ break;
2769
+ case 'number':
2770
+ typename = '数字';
2771
+ break;
2772
+ case 'english':
2773
+ typename = '英文';
2774
+ break;
2775
+ case 'chinese':
2776
+ typename = '中文';
2777
+ break;
2778
+ case 'lower':
2779
+ typename = '小写';
2780
+ break;
2781
+ case 'upper':
2782
+ typename = '大写';
2783
+ break;
2784
+ case 'HTML':
2785
+ typename = 'HTML标记';
2786
+ break;
2787
+ default:
2788
+ break;
2789
+ }
2790
+ if (!bool) {
2791
+ throw Error(ErrorTypeConstant.PARAMETER_ERROR + ':>>>不是' + typename);
2792
+ }
2793
+ }
2794
+ });
2690
2795
  // CONCATENATED MODULE: ./src/index.js
2691
2796
 
2692
2797
 
@@ -2699,6 +2804,7 @@ var DevicePixelRatio = function () {
2699
2804
 
2700
2805
 
2701
2806
 
2807
+
2702
2808
  /***/ })
2703
2809
  /******/ ]);
2704
2810
  });
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": "2.2.7",
5
+ "version": "2.2.8",
6
6
  "author": "Guo.Yan <luv02@vip.qq.com>",
7
7
  "license": "MIT",
8
8
  "private": false,