qmwts 1.1.66 → 1.1.67

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.
@@ -3,6 +3,7 @@ export default class LocalDate {
3
3
  constructor();
4
4
  constructor(date: Date);
5
5
  static now(): LocalDate;
6
+ static parse(date: string | number): LocalDate;
6
7
  static of(year: number, month: number, date: number): LocalDate;
7
8
  getYear(): number;
8
9
  getMonth(): number;
@@ -3,14 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // https://juejin.cn/post/7098891689955164168
4
4
  class LocalDate {
5
5
  constructor(date) {
6
- if (date == void 0)
7
- this.date = new Date();
8
- else
6
+ if (date instanceof Date)
9
7
  this.date = date;
8
+ else
9
+ this.date = new Date();
10
10
  }
11
11
  static now() {
12
12
  return new LocalDate();
13
13
  }
14
+ static parse(date) {
15
+ return new LocalDate(new Date(date));
16
+ }
14
17
  static of(year, month, date) {
15
18
  return new LocalDate(new Date(year, month - 1, date));
16
19
  }
@@ -12,7 +12,7 @@ exports.default = {
12
12
  o = '';
13
13
  }
14
14
  }
15
- if ([void 0, null].includes(o))
15
+ if (o == null)
16
16
  return substitute;
17
17
  return o;
18
18
  },
@@ -6,12 +6,9 @@ exports.default = {
6
6
  if (Array.isArray(value))
7
7
  for (const i of value)
8
8
  params.append(key, i);
9
- else if (isValidValue(value))
9
+ else if (value != null)
10
10
  params.append(key, value);
11
11
  }
12
12
  return params;
13
13
  }
14
14
  };
15
- function isValidValue(value) {
16
- return value !== null && value !== void 0;
17
- }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  trimAll(str) {
5
- if ([void 0, null].includes(str))
5
+ if (str == null)
6
6
  return '';
7
7
  return String(str).split('').map(e => e.trim()).join('');
8
8
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qmwts",
3
- "version": "1.1.66",
3
+ "version": "1.1.67",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",