ph-utils 0.4.0 → 0.4.1

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/date.d.ts CHANGED
@@ -34,10 +34,10 @@ export declare function endOf(date?: Date | string | number, unit?: string): Dat
34
34
  /**
35
35
  * 获取时间戳
36
36
  * @param ctime 时间
37
- * @param unit 时间戳长度
37
+ * @param pre 精度, s - 精确到秒, ms - 精确到毫秒, 默认: s
38
38
  * @returns
39
39
  */
40
- export declare function timeStamp(ctime?: Date | string | number, unit?: 's' | 'ms'): number;
40
+ export declare function timeStamp(ctime?: Date | string | number, pre?: 's' | 'ms'): number;
41
41
  /**
42
42
  * 日期加上指定时间后的日期
43
43
  * @param date 指定的日期
package/lib/date.js CHANGED
@@ -166,12 +166,12 @@ export function endOf(date, unit) {
166
166
  /**
167
167
  * 获取时间戳
168
168
  * @param ctime 时间
169
- * @param unit 时间戳长度
169
+ * @param pre 精度, s - 精确到秒, ms - 精确到毫秒, 默认: s
170
170
  * @returns
171
171
  */
172
- export function timeStamp(ctime, unit = 's') {
172
+ export function timeStamp(ctime, pre = 's') {
173
173
  let tm = parse(ctime).getTime();
174
- return unit === 's' ? Math.floor(tm / 1000) : tm;
174
+ return pre === 's' ? Math.floor(tm / 1000) : tm;
175
175
  }
176
176
  /**
177
177
  * 日期加上指定时间后的日期
package/package.json CHANGED
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "./*": "./lib/*"
50
50
  },
51
- "version": "0.4.0",
51
+ "version": "0.4.1",
52
52
  "type": "module",
53
53
  "repository": {
54
54
  "type": "git",