fast-vue-multi-pages 1.0.7 → 1.0.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.
@@ -25,7 +25,7 @@ class FastVueMultiDate {
25
25
  */
26
26
  static format(source, pattern) {
27
27
  if (lodash_1.default.isEmpty(pattern)) {
28
- return null;
28
+ return source.toLocaleString();
29
29
  }
30
30
  if (lodash_1.default.isEmpty(source)) {
31
31
  return null;
@@ -49,7 +49,7 @@ class FastVueMultiDate {
49
49
  */
50
50
  static formatNice(source, level) {
51
51
  if (lodash_1.default.isEmpty(source)) {
52
- return null;
52
+ return source;
53
53
  }
54
54
  if (level === undefined) {
55
55
  level = 2;
@@ -63,7 +63,7 @@ class FastVueMultiDate {
63
63
  const time1 = new Date().getTime(); //当前的时间戳
64
64
  const sourceDate = this.parse(source);
65
65
  if (!sourceDate) {
66
- return null;
66
+ return source;
67
67
  }
68
68
  const time2 = sourceDate.getTime();
69
69
  const time = time1 - time2;
@@ -27,7 +27,7 @@ define(["require", "exports", "tslib", "moment", "lodash"], function (require, e
27
27
  */
28
28
  FastVueMultiDate.format = function (source, pattern) {
29
29
  if (lodash_1.default.isEmpty(pattern)) {
30
- return null;
30
+ return source.toLocaleString();
31
31
  }
32
32
  if (lodash_1.default.isEmpty(source)) {
33
33
  return null;
@@ -51,7 +51,7 @@ define(["require", "exports", "tslib", "moment", "lodash"], function (require, e
51
51
  */
52
52
  FastVueMultiDate.formatNice = function (source, level) {
53
53
  if (lodash_1.default.isEmpty(source)) {
54
- return null;
54
+ return source;
55
55
  }
56
56
  if (level === undefined) {
57
57
  level = 2;
@@ -65,7 +65,7 @@ define(["require", "exports", "tslib", "moment", "lodash"], function (require, e
65
65
  var time1 = new Date().getTime(); //当前的时间戳
66
66
  var sourceDate = this.parse(source);
67
67
  if (!sourceDate) {
68
- return null;
68
+ return source;
69
69
  }
70
70
  var time2 = sourceDate.getTime();
71
71
  var time = time1 - time2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-vue-multi-pages",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "author": "janesen",
5
5
  "description": "快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html",
6
6
  "main": "./dist/cjs/index.js",
@@ -30,7 +30,8 @@
30
30
  "moment": "^2.30.1",
31
31
  "@types/js-cookie": "^3.0.6",
32
32
  "@types/lodash": "^4.17.6",
33
- "copy-to-clipboard": "^3.3.3"
33
+ "copy-to-clipboard": "^3.3.3",
34
+ "ip": "^2.0.1"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@typescript-eslint/eslint-plugin": "^7.16.0",
@@ -51,4 +51,8 @@ export declare class FastVueMultiPages {
51
51
  * @param path
52
52
  */
53
53
  private static removeFile;
54
+ /**
55
+ * 获取本机IP地址
56
+ */
57
+ static getLocalIP(): string;
54
58
  }
@@ -275,5 +275,12 @@ class FastVueMultiPages {
275
275
  fs.rmdirSync(path); // 删除文件夹自身
276
276
  }
277
277
  }
278
+ /**
279
+ * 获取本机IP地址
280
+ */
281
+ static getLocalIP() {
282
+ let ip = require('ip');
283
+ return ip.address();
284
+ }
278
285
  }
279
286
  exports.FastVueMultiPages = FastVueMultiPages;