mazey 1.4.23 → 1.4.27

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.
package/lib/index.esm.js CHANGED
@@ -3297,12 +3297,17 @@ function resetForm() {
3297
3297
  /**
3298
3298
  * @method floatToPercent
3299
3299
  * @description 浮点数转为百分比 0.2 => 20%。
3300
- * @param {Number} 浮点数。
3300
+ * @param {Number} num 浮点数
3301
+ * @param {Number} fixSize 保留几位浮点数
3301
3302
  * */
3302
3303
 
3303
- function floatToPercent(num, isFix) {
3304
- if (isFix) {
3305
- num = (num * 100).toFixed(isFix);
3304
+ function floatToPercent(num, fixSize) {
3305
+ if (fixSize === void 0) {
3306
+ fixSize = 0;
3307
+ }
3308
+
3309
+ if (fixSize) {
3310
+ num = (num * 100).toFixed(fixSize);
3306
3311
  } else {
3307
3312
  num = Math.floor(num * 100);
3308
3313
  }
@@ -3756,7 +3761,7 @@ function getLocalStorage(key) {
3756
3761
 
3757
3762
  return ret;
3758
3763
  }
3759
- /*
3764
+ /**
3760
3765
  * @method loadCSS
3761
3766
  * @description 动态加载css文件
3762
3767
  * @param {String} url -- css资源路径
@@ -3885,13 +3890,14 @@ function loadCSS(_a) {
3885
3890
 
3886
3891
  return status;
3887
3892
  }
3888
- /*
3893
+ /**
3889
3894
  * @method loadScript
3890
3895
  * @description 动态加载js文件
3891
3896
  * @param {String} url -- js资源路径
3892
3897
  * @param {String} id -- DOM ID
3893
3898
  * @param {Function} callback -- 加载后回调函数
3894
3899
  * @param {Number} timeout -- 超时时长
3900
+ * @param {Boolean} isDefer -- 是否添加 defer 标签
3895
3901
  * @return {Promise<Boolean>} -- true 成功
3896
3902
  */
3897
3903
 
@@ -3904,7 +3910,9 @@ function loadScript(_a) {
3904
3910
  _e = _b.callback,
3905
3911
  callback = _e === void 0 ? function () {} : _e,
3906
3912
  _f = _b.timeout,
3907
- timeout = _f === void 0 ? 5000 : _f;
3913
+ timeout = _f === void 0 ? 5000 : _f,
3914
+ _g = _b.isDefer,
3915
+ isDefer = _g === void 0 ? false : _g;
3908
3916
 
3909
3917
  var success = null;
3910
3918
  var fail = null;
@@ -3913,6 +3921,10 @@ function loadScript(_a) {
3913
3921
  var firstScript = document.getElementsByTagName('script')[0];
3914
3922
  script.type = 'text/javascript';
3915
3923
 
3924
+ if (isDefer) {
3925
+ script.defer = 'defer';
3926
+ }
3927
+
3916
3928
  if (id) {
3917
3929
  script.id = id;
3918
3930
  }
@@ -3946,7 +3958,7 @@ function loadScript(_a) {
3946
3958
  }
3947
3959
  });
3948
3960
  }
3949
- /*
3961
+ /**
3950
3962
  * @method mNow
3951
3963
  * @description 获取时间戳
3952
3964
  */
@@ -3962,7 +3974,7 @@ function mNow() {
3962
3974
 
3963
3975
  return ret;
3964
3976
  }
3965
- /*
3977
+ /**
3966
3978
  * @method setCookie
3967
3979
  * @description 设置 Cookie
3968
3980
  */
@@ -4007,7 +4019,7 @@ function setCookie(name, value, days, domain) {
4007
4019
  }
4008
4020
  }
4009
4021
  }
4010
- /*
4022
+ /**
4011
4023
  * @method getCookie
4012
4024
  * @description 获取 Cookie
4013
4025
  */
@@ -4028,7 +4040,7 @@ function getCookie(name) {
4028
4040
 
4029
4041
  return null;
4030
4042
  }
4031
- /*
4043
+ /**
4032
4044
  * @method getPerformance
4033
4045
  * @description 获取页面加载相关的各项数据
4034
4046
  * @param {Boolean} camelCase -- true(默认) 以驼峰形式返回数据 false 以下划线形式返回数据
@@ -4107,13 +4119,18 @@ function getPerformance(_a) {
4107
4119
  renderTime: timing.loadEventEnd - startTime || 0,
4108
4120
  decodedBodySize: performanceNavigationTiming.decodedBodySize || '',
4109
4121
  encodedBodySize: performanceNavigationTiming.encodedBodySize || ''
4110
- }; // 过滤掉 <0 的数据
4122
+ }; // 过滤异常数据
4111
4123
 
4112
4124
  Object.keys(data_1).forEach(function (k) {
4125
+ // 过滤掉 <0 的数据
4113
4126
  if (isNumber(data_1[k]) && data_1[k] < 0) {
4114
4127
  data_1[k] = 0;
4115
4128
  }
4116
- });
4129
+ }); // 过滤掉白屏时间 > onload 的数据
4130
+
4131
+ if (isNumber(data_1.whiteTime) && data_1.whiteTime > data_1.onloadTime) {
4132
+ data_1.whiteTime = 0;
4133
+ }
4117
4134
 
4118
4135
  if (startTime > 0) {
4119
4136
  var Underscore_1;
@@ -4270,7 +4287,7 @@ function getPerformance(_a) {
4270
4287
 
4271
4288
  return status;
4272
4289
  }
4273
- /*
4290
+ /**
4274
4291
  * @method inRate
4275
4292
  * @description 百分位概率
4276
4293
  * @param {Number} rate -- 0.1 ~ 1 => 1% ~ 100%
@@ -4284,7 +4301,7 @@ function inRate(rate) {
4284
4301
 
4285
4302
  return false;
4286
4303
  }
4287
- /*
4304
+ /**
4288
4305
  * @method isSafePWAEnv
4289
4306
  * @description 判断是否是安全的 PWA 环境
4290
4307
  * @return {Boolean} true 是
@@ -4293,19 +4310,20 @@ function inRate(rate) {
4293
4310
  function isSafePWAEnv() {
4294
4311
  // 判断是否支持 async await
4295
4312
  function isSupportAsyncAwait() {
4296
- var func;
4313
+ var isSupportAsyncAwaitFunc;
4297
4314
 
4298
4315
  try {
4299
4316
  // eval("func = async function(){};");
4300
- new Function("var isSupportAsyncAwaitFunc = async function(){};");
4317
+ var fn = new Function("return async function(){};");
4318
+ isSupportAsyncAwaitFunc = fn(); // console.log('isSupportAsyncAwaitFunc', isSupportAsyncAwaitFunc);
4319
+ // 由于async函数的构造器不是全局对象,所以我们需要由下面代码来获取async函数的构造器
4320
+ // 具体可以查看以下MDN上有关于AsyncFunction的说明,
4321
+ // 地址:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction
4322
+
4323
+ return Object.getPrototypeOf(isSupportAsyncAwaitFunc).constructor != null;
4301
4324
  } catch (e) {
4302
4325
  return false;
4303
- } // 由于async函数的构造器不是全局对象,所以我们需要由下面代码来获取async函数的构造器
4304
- // 具体可以查看以下MDN上有关于AsyncFunction的说明,
4305
- // 地址:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction
4306
-
4307
-
4308
- return Object.getPrototypeOf(func).constructor != null;
4326
+ }
4309
4327
  } // 判断是否支持 Promise
4310
4328
 
4311
4329
 
@@ -4326,181 +4344,254 @@ function isSafePWAEnv() {
4326
4344
 
4327
4345
  return false;
4328
4346
  }
4329
- /*
4330
- * @method showBrowserType
4347
+ /**
4348
+ * @method getBrowserType
4331
4349
  * @description 返回浏览器信息 https://github.com/JowayYoung/juejin-code/blob/master/browser-type.js
4332
4350
  * @return {Object} 浏览器信息
4333
4351
  */
4334
4352
 
4335
4353
  function getBrowserType() {
4336
- // 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
4337
- var ua = navigator.userAgent.toLowerCase();
4354
+ try {
4355
+ // 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
4356
+ var ua_1 = navigator.userAgent.toLowerCase();
4338
4357
 
4339
- var testUa = function testUa(regexp) {
4340
- return regexp.test(ua);
4341
- };
4358
+ var testUa = function testUa(regexp) {
4359
+ return regexp.test(ua_1);
4360
+ };
4361
+
4362
+ var testVs = function testVs(regexp) {
4363
+ return ua_1.match(regexp).toString().replace(/[^0-9|_.]/g, "").replace(/_/g, ".");
4364
+ }; // 系统
4365
+
4366
+
4367
+ var system = "unknow";
4368
+
4369
+ if (testUa(/windows|win32|win64|wow32|wow64/g)) {
4370
+ system = "windows"; // windows系统
4371
+ } else if (testUa(/macintosh|macintel/g)) {
4372
+ system = "macos"; // macos系统
4373
+ } else if (testUa(/x11/g)) {
4374
+ system = "linux"; // linux系统
4375
+ } else if (testUa(/android|adr/g)) {
4376
+ system = "android"; // android系统
4377
+ } else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
4378
+ system = "ios"; // ios系统
4379
+ } // 系统版本
4380
+
4381
+
4382
+ var systemVs = "unknow";
4383
+
4384
+ if (system === "windows") {
4385
+ if (testUa(/windows nt 5.0|windows 2000/g)) {
4386
+ systemVs = "2000";
4387
+ } else if (testUa(/windows nt 5.1|windows xp/g)) {
4388
+ systemVs = "xp";
4389
+ } else if (testUa(/windows nt 5.2|windows 2003/g)) {
4390
+ systemVs = "2003";
4391
+ } else if (testUa(/windows nt 6.0|windows vista/g)) {
4392
+ systemVs = "vista";
4393
+ } else if (testUa(/windows nt 6.1|windows 7/g)) {
4394
+ systemVs = "7";
4395
+ } else if (testUa(/windows nt 6.2|windows 8/g)) {
4396
+ systemVs = "8";
4397
+ } else if (testUa(/windows nt 6.3|windows 8.1/g)) {
4398
+ systemVs = "8.1";
4399
+ } else if (testUa(/windows nt 10.0|windows 10/g)) {
4400
+ systemVs = "10";
4401
+ }
4402
+ } else if (system === "macos") {
4403
+ systemVs = testVs(/os x [\d._]+/g);
4404
+ } else if (system === "android") {
4405
+ systemVs = testVs(/android [\d._]+/g);
4406
+ } else if (system === "ios") {
4407
+ systemVs = testVs(/os [\d._]+/g);
4408
+ } // 平台
4409
+
4410
+
4411
+ var platform = "unknow";
4412
+
4413
+ if (system === "windows" || system === "macos" || system === "linux") {
4414
+ platform = "desktop"; // 桌面端
4415
+ } else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
4416
+ platform = "mobile"; // 移动端
4417
+ } // 内核和载体
4418
+
4419
+
4420
+ var engine = "unknow";
4421
+ var supporter = "unknow";
4422
+
4423
+ if (testUa(/applewebkit/g)) {
4424
+ engine = "webkit"; // webkit内核
4425
+
4426
+ if (testUa(/edge/g)) {
4427
+ supporter = "edge"; // edge浏览器
4428
+ } else if (testUa(/opr/g)) {
4429
+ supporter = "opera"; // opera浏览器
4430
+ } else if (testUa(/chrome/g)) {
4431
+ supporter = "chrome"; // chrome浏览器
4432
+ } else if (testUa(/safari/g)) {
4433
+ supporter = "safari"; // safari浏览器
4434
+ }
4435
+ } else if (testUa(/gecko/g) && testUa(/firefox/g)) {
4436
+ engine = "gecko"; // gecko内核
4342
4437
 
4343
- var testVs = function testVs(regexp) {
4344
- return ua.match(regexp).toString().replace(/[^0-9|_.]/g, "").replace(/_/g, ".");
4345
- }; // 系统
4346
-
4347
-
4348
- var system = "unknow";
4349
-
4350
- if (testUa(/windows|win32|win64|wow32|wow64/g)) {
4351
- system = "windows"; // windows系统
4352
- } else if (testUa(/macintosh|macintel/g)) {
4353
- system = "macos"; // macos系统
4354
- } else if (testUa(/x11/g)) {
4355
- system = "linux"; // linux系统
4356
- } else if (testUa(/android|adr/g)) {
4357
- system = "android"; // android系统
4358
- } else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
4359
- system = "ios"; // ios系统
4360
- } // 系统版本
4361
-
4362
-
4363
- var systemVs = "unknow";
4364
-
4365
- if (system === "windows") {
4366
- if (testUa(/windows nt 5.0|windows 2000/g)) {
4367
- systemVs = "2000";
4368
- } else if (testUa(/windows nt 5.1|windows xp/g)) {
4369
- systemVs = "xp";
4370
- } else if (testUa(/windows nt 5.2|windows 2003/g)) {
4371
- systemVs = "2003";
4372
- } else if (testUa(/windows nt 6.0|windows vista/g)) {
4373
- systemVs = "vista";
4374
- } else if (testUa(/windows nt 6.1|windows 7/g)) {
4375
- systemVs = "7";
4376
- } else if (testUa(/windows nt 6.2|windows 8/g)) {
4377
- systemVs = "8";
4378
- } else if (testUa(/windows nt 6.3|windows 8.1/g)) {
4379
- systemVs = "8.1";
4380
- } else if (testUa(/windows nt 10.0|windows 10/g)) {
4381
- systemVs = "10";
4438
+ supporter = "firefox"; // firefox浏览器
4439
+ } else if (testUa(/presto/g)) {
4440
+ engine = "presto"; // presto内核
4441
+
4442
+ supporter = "opera"; // opera浏览器
4443
+ } else if (testUa(/trident|compatible|msie/g)) {
4444
+ engine = "trident"; // trident内核
4445
+
4446
+ supporter = "iexplore"; // iexplore浏览器
4447
+ } // 内核版本
4448
+
4449
+
4450
+ var engineVs = "unknow";
4451
+
4452
+ if (engine === "webkit") {
4453
+ engineVs = testVs(/applewebkit\/[\d._]+/g);
4454
+ } else if (engine === "gecko") {
4455
+ engineVs = testVs(/gecko\/[\d._]+/g);
4456
+ } else if (engine === "presto") {
4457
+ engineVs = testVs(/presto\/[\d._]+/g);
4458
+ } else if (engine === "trident") {
4459
+ engineVs = testVs(/trident\/[\d._]+/g);
4460
+ } // 载体版本
4461
+
4462
+
4463
+ var supporterVs = "unknow";
4464
+
4465
+ if (supporter === "chrome") {
4466
+ supporterVs = testVs(/chrome\/[\d._]+/g);
4467
+ } else if (supporter === "safari") {
4468
+ supporterVs = testVs(/version\/[\d._]+/g);
4469
+ } else if (supporter === "firefox") {
4470
+ supporterVs = testVs(/firefox\/[\d._]+/g);
4471
+ } else if (supporter === "opera") {
4472
+ supporterVs = testVs(/opr\/[\d._]+/g);
4473
+ } else if (supporter === "iexplore") {
4474
+ supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
4475
+ } else if (supporter === "edge") {
4476
+ supporterVs = testVs(/edge\/[\d._]+/g);
4477
+ } // 外壳和外壳版本
4478
+
4479
+
4480
+ var shell = "none";
4481
+ var shellVs = "unknow";
4482
+
4483
+ if (testUa(/micromessenger/g)) {
4484
+ shell = "wechat"; // 微信浏览器
4485
+
4486
+ shellVs = testVs(/micromessenger\/[\d._]+/g);
4487
+ } else if (testUa(/qqbrowser/g)) {
4488
+ shell = "qq"; // QQ浏览器
4489
+
4490
+ shellVs = testVs(/qqbrowser\/[\d._]+/g);
4491
+ } else if (testUa(/ucbrowser/g)) {
4492
+ shell = "uc"; // UC浏览器
4493
+
4494
+ shellVs = testVs(/ucbrowser\/[\d._]+/g);
4495
+ } else if (testUa(/qihu 360se/g)) {
4496
+ shell = "360"; // 360浏览器(无版本)
4497
+ } else if (testUa(/2345explorer/g)) {
4498
+ shell = "2345"; // 2345浏览器
4499
+
4500
+ shellVs = testVs(/2345explorer\/[\d._]+/g);
4501
+ } else if (testUa(/metasr/g)) {
4502
+ shell = "sougou"; // 搜狗浏览器(无版本)
4503
+ } else if (testUa(/lbbrowser/g)) {
4504
+ shell = "liebao"; // 猎豹浏览器(无版本)
4505
+ } else if (testUa(/maxthon/g)) {
4506
+ shell = "maxthon"; // 遨游浏览器
4507
+
4508
+ shellVs = testVs(/maxthon\/[\d._]+/g);
4382
4509
  }
4383
- } else if (system === "macos") {
4384
- systemVs = testVs(/os x [\d._]+/g);
4385
- } else if (system === "android") {
4386
- systemVs = testVs(/android [\d._]+/g);
4387
- } else if (system === "ios") {
4388
- systemVs = testVs(/os [\d._]+/g);
4389
- } // 平台
4390
4510
 
4511
+ return Object.assign({
4512
+ engine: engine,
4513
+ engineVs: engineVs,
4514
+ platform: platform,
4515
+ supporter: supporter,
4516
+ supporterVs: supporterVs,
4517
+ system: system,
4518
+ systemVs: systemVs
4519
+ }, shell === "none" ? {} : {
4520
+ shell: shell,
4521
+ shellVs: shellVs
4522
+ });
4523
+ } catch (err) {
4524
+ return {};
4525
+ }
4526
+ }
4527
+ /**
4528
+ * @method clearHtml
4529
+ * @description 去除HTML标签
4530
+ * @param {String} string 带html标签的字符串
4531
+ * @return {String} 字符串
4532
+ */
4391
4533
 
4392
- var platform = "unknow";
4534
+ function clearHtml(string) {
4535
+ if (string === void 0) {
4536
+ string = '';
4537
+ }
4393
4538
 
4394
- if (system === "windows" || system === "macos" || system === "linux") {
4395
- platform = "desktop"; // 桌面端
4396
- } else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
4397
- platform = "mobile"; // 移动端
4398
- } // 内核和载体
4539
+ return string.replace(/<\/?.+?>/g, '').replace(/[\r\n]/g, '');
4540
+ }
4541
+ /**
4542
+ * @method cutCHSString
4543
+ * @description 截取字符串,中文算2个字节
4544
+ * @param {String} str 要截取的字符串
4545
+ * @param {Number} len
4546
+ * @param {Boolean} hasDot
4547
+ * @returns {String} 返回截取后的字符串
4548
+ */
4399
4549
 
4550
+ function cutCHSString(str, len, hasDot) {
4551
+ if (str === void 0) {
4552
+ str = '';
4553
+ }
4400
4554
 
4401
- var engine = "unknow";
4402
- var supporter = "unknow";
4555
+ if (len === void 0) {
4556
+ len = str.length;
4557
+ }
4403
4558
 
4404
- if (testUa(/applewebkit/g)) {
4405
- engine = "webkit"; // webkit内核
4559
+ if (hasDot === void 0) {
4560
+ hasDot = false;
4561
+ }
4406
4562
 
4407
- if (testUa(/edge/g)) {
4408
- supporter = "edge"; // edge浏览器
4409
- } else if (testUa(/opr/g)) {
4410
- supporter = "opera"; // opera浏览器
4411
- } else if (testUa(/chrome/g)) {
4412
- supporter = "chrome"; // chrome浏览器
4413
- } else if (testUa(/safari/g)) {
4414
- supporter = "safari"; // safari浏览器
4563
+ if (str == '' || !str) {
4564
+ return '';
4565
+ } else {
4566
+ var newLength = 0;
4567
+ var newStr = ''; // eslint-disable-next-line no-control-regex
4568
+
4569
+ var chineseRegex = /[^\x00-\xff]/g;
4570
+ var singleChar = '';
4571
+ var strLength = str.replace(chineseRegex, '**').length;
4572
+
4573
+ for (var i = 0; i < strLength; i++) {
4574
+ singleChar = str.charAt(i).toString();
4575
+
4576
+ if (singleChar.match(chineseRegex) != null) {
4577
+ newLength += 2;
4578
+ } else {
4579
+ newLength++;
4580
+ }
4581
+
4582
+ if (newLength > len) {
4583
+ break;
4584
+ }
4585
+
4586
+ newStr += singleChar;
4415
4587
  }
4416
- } else if (testUa(/gecko/g) && testUa(/firefox/g)) {
4417
- engine = "gecko"; // gecko内核
4418
-
4419
- supporter = "firefox"; // firefox浏览器
4420
- } else if (testUa(/presto/g)) {
4421
- engine = "presto"; // presto内核
4422
-
4423
- supporter = "opera"; // opera浏览器
4424
- } else if (testUa(/trident|compatible|msie/g)) {
4425
- engine = "trident"; // trident内核
4426
-
4427
- supporter = "iexplore"; // iexplore浏览器
4428
- } // 内核版本
4429
-
4430
-
4431
- var engineVs = "unknow";
4432
-
4433
- if (engine === "webkit") {
4434
- engineVs = testVs(/applewebkit\/[\d._]+/g);
4435
- } else if (engine === "gecko") {
4436
- engineVs = testVs(/gecko\/[\d._]+/g);
4437
- } else if (engine === "presto") {
4438
- engineVs = testVs(/presto\/[\d._]+/g);
4439
- } else if (engine === "trident") {
4440
- engineVs = testVs(/trident\/[\d._]+/g);
4441
- } // 载体版本
4442
-
4443
-
4444
- var supporterVs = "unknow";
4445
-
4446
- if (supporter === "chrome") {
4447
- supporterVs = testVs(/chrome\/[\d._]+/g);
4448
- } else if (supporter === "safari") {
4449
- supporterVs = testVs(/version\/[\d._]+/g);
4450
- } else if (supporter === "firefox") {
4451
- supporterVs = testVs(/firefox\/[\d._]+/g);
4452
- } else if (supporter === "opera") {
4453
- supporterVs = testVs(/opr\/[\d._]+/g);
4454
- } else if (supporter === "iexplore") {
4455
- supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
4456
- } else if (supporter === "edge") {
4457
- supporterVs = testVs(/edge\/[\d._]+/g);
4458
- } // 外壳和外壳版本
4459
-
4460
-
4461
- var shell = "none";
4462
- var shellVs = "unknow";
4463
-
4464
- if (testUa(/micromessenger/g)) {
4465
- shell = "wechat"; // 微信浏览器
4466
-
4467
- shellVs = testVs(/micromessenger\/[\d._]+/g);
4468
- } else if (testUa(/qqbrowser/g)) {
4469
- shell = "qq"; // QQ浏览器
4470
-
4471
- shellVs = testVs(/qqbrowser\/[\d._]+/g);
4472
- } else if (testUa(/ucbrowser/g)) {
4473
- shell = "uc"; // UC浏览器
4474
-
4475
- shellVs = testVs(/ucbrowser\/[\d._]+/g);
4476
- } else if (testUa(/qihu 360se/g)) {
4477
- shell = "360"; // 360浏览器(无版本)
4478
- } else if (testUa(/2345explorer/g)) {
4479
- shell = "2345"; // 2345浏览器
4480
-
4481
- shellVs = testVs(/2345explorer\/[\d._]+/g);
4482
- } else if (testUa(/metasr/g)) {
4483
- shell = "sougou"; // 搜狗浏览器(无版本)
4484
- } else if (testUa(/lbbrowser/g)) {
4485
- shell = "liebao"; // 猎豹浏览器(无版本)
4486
- } else if (testUa(/maxthon/g)) {
4487
- shell = "maxthon"; // 遨游浏览器
4488
-
4489
- shellVs = testVs(/maxthon\/[\d._]+/g);
4490
- }
4491
4588
 
4492
- return Object.assign({
4493
- engine: engine,
4494
- engineVs: engineVs,
4495
- platform: platform,
4496
- supporter: supporter,
4497
- supporterVs: supporterVs,
4498
- system: system,
4499
- systemVs: systemVs
4500
- }, shell === "none" ? {} : {
4501
- shell: shell,
4502
- shellVs: shellVs
4503
- });
4589
+ if (hasDot && strLength > len) {
4590
+ newStr += '...';
4591
+ }
4592
+
4593
+ return newStr;
4594
+ }
4504
4595
  }
4505
4596
 
4506
- export { addClass, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, compatibleExist, debounce, deepCopyObject, doFn, floatFixed, floatToPercent, friendlyInterval, generateRndNum, generateUniqueNum, getBrowserType, getCookie, getDomain, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getSearchQueryParam, getSessionStorage, getUrlParam, hasClass, inRate, isJsonString, isNumber, isSafePWAEnv, join, loadCSS, loadScript, mNow, newLine, removeClass, renderTable, resetForm, setCookie, setLocalStorage, setSessionStorage, throttle, trim$1 as trim, updateQueryStringParameter };
4597
+ export { addClass, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHtml, compatibleExist, cutCHSString, debounce, deepCopyObject, doFn, floatFixed, floatToPercent, friendlyInterval, generateRndNum, generateUniqueNum, getBrowserType, getCookie, getDomain, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getSearchQueryParam, getSessionStorage, getUrlParam, hasClass, inRate, isJsonString, isNumber, isSafePWAEnv, join, loadCSS, loadScript, mNow, newLine, removeClass, renderTable, resetForm, setCookie, setLocalStorage, setSessionStorage, throttle, trim$1 as trim, updateQueryStringParameter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mazey",
3
- "version": "1.4.23",
3
+ "version": "1.4.27",
4
4
  "description": "Mazey's library for front end.",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",