mm_expand 1.6.0 → 1.6.2

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.
Files changed (3) hide show
  1. package/index.js +20 -4
  2. package/package.json +1 -1
  3. package/test.js +2 -1
package/index.js CHANGED
@@ -1038,8 +1038,17 @@ if (typeof($) === "undefined") {
1038
1038
  * @return {Date} 时间对象
1039
1039
  */
1040
1040
  String.prototype.toTime = function() {
1041
- var str = this.replace('T', ' ').replace('Z', '').replaceAll('-', '/');
1042
- return new Date(str);
1041
+ var str = this;
1042
+ var time;
1043
+ if (str.indexOf('T')) {
1044
+ str = this.replace('T', ' ').replace('Z', '').replaceAll('-', '/');
1045
+ time = new Date(str).addSeconds(28800);
1046
+ }
1047
+ else {
1048
+ str = this.replaceAll('-', '/');
1049
+ time = new Date(str);
1050
+ }
1051
+ return time;
1043
1052
  };
1044
1053
  /**
1045
1054
  * @description 转为时间格式字符串
@@ -1254,8 +1263,15 @@ if (typeof($) === "undefined") {
1254
1263
  file = join(dir, file);
1255
1264
  }
1256
1265
  }
1257
- if (file.indexOf('.') === -1 && !file.endsWith(slash)) {
1258
- file += slash;
1266
+ if (!file.endsWith(slash)) {
1267
+ if (file.indexOf('.') === -1) {
1268
+ file += slash;
1269
+ } else {
1270
+ var arr = file.split(slash);
1271
+ if (arr[arr.length - 1].indexOf('.') === -1) {
1272
+ file += slash;
1273
+ }
1274
+ }
1259
1275
  }
1260
1276
  return file;
1261
1277
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_expand",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "这是超级美眉原型函数拓展模块,更有利于对string、array、object的操作,避免出错,简化业务逻辑。",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test.js CHANGED
@@ -14,10 +14,11 @@ console.log("/fast/log".fullname());
14
14
  console.log("/fast/log/".fullname());
15
15
  console.log("/fast/log.lgo".fullname());
16
16
  console.log("/fast/log.lgo\\".fullname());
17
- console.log("/fast/log.lgo/".fullname());
18
17
  console.log("E:\\github\\mm_modules\\mm_expand\\fast\\log\\".fullname(__dirname));
19
18
  console.log("E:\\github\\mm_modules\\mm_expand\\fast\\log\\".fullname());
20
19
  console.log("E:\\github\\mm_modules\\mm_expand\\fast\\log".fullname());
20
+
21
+ console.log("/fast/log.lgo\\log".fullname());
21
22
  // var arr1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];
22
23
 
23
24
  // var arr1 = [{