@base-web-kits/base-tools-ts 1.4.10 → 1.4.16
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/dist/base-tools-ts.umd.global.js +1 -1
- package/dist/base-tools-ts.umd.global.js.map +1 -1
- package/dist/day/index.d.ts +3 -1
- package/dist/day/index.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ts/clsx/index.ts +3 -3
- package/src/ts/day/index.ts +4 -1
- package/src/ts/url/oss/index.ts +4 -4
package/package.json
CHANGED
package/src/ts/clsx/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** 根据字符串、数组和条件对象拼接 CSS 类名 */
|
|
2
|
-
export { clsx } from 'clsx';
|
|
3
|
-
export type { ClassValue } from 'clsx';
|
|
1
|
+
/** 根据字符串、数组和条件对象拼接 CSS 类名 */
|
|
2
|
+
export { clsx } from 'clsx';
|
|
3
|
+
export type { ClassValue } from 'clsx';
|
package/src/ts/day/index.ts
CHANGED
|
@@ -7,6 +7,9 @@ import advancedFormat from 'dayjs/plugin/advancedFormat.js';
|
|
|
7
7
|
import 'dayjs/locale/zh-cn.js';
|
|
8
8
|
import { zeroPad } from '../number';
|
|
9
9
|
|
|
10
|
+
/** Day.js 实例类型 */
|
|
11
|
+
export type Dayjs = dayjs.Dayjs;
|
|
12
|
+
|
|
10
13
|
dayjs.extend(customParseFormat);
|
|
11
14
|
dayjs.extend(utc);
|
|
12
15
|
dayjs.extend(timezone);
|
|
@@ -14,7 +17,7 @@ dayjs.extend(relativeTime);
|
|
|
14
17
|
dayjs.extend(advancedFormat);
|
|
15
18
|
dayjs.locale('zh-cn');
|
|
16
19
|
|
|
17
|
-
type BaseTime = number | string | Date |
|
|
20
|
+
type BaseTime = number | string | Date | Dayjs | null | undefined;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* 创建 dayjs 实例
|
package/src/ts/url/oss/index.ts
CHANGED
|
@@ -128,10 +128,10 @@ function getOSSSegs(type: string, option?: Record<string, unknown> | number | st
|
|
|
128
128
|
|
|
129
129
|
if (typeof option === 'number' || typeof option === 'string') return `${type},${option}`;
|
|
130
130
|
|
|
131
|
-
const segs = Object.entries(option)
|
|
132
|
-
.filter(([, v]) => v !== null && v !== undefined)
|
|
133
|
-
.map(([k, v]) => `${k}_${v}`)
|
|
134
|
-
.join(',');
|
|
131
|
+
const segs = Object.entries(option)
|
|
132
|
+
.filter(([, v]) => v !== null && v !== undefined && !Number.isNaN(v))
|
|
133
|
+
.map(([k, v]) => `${k}_${v}`)
|
|
134
|
+
.join(',');
|
|
135
135
|
|
|
136
136
|
return segs ? `${type},${segs}` : '';
|
|
137
137
|
}
|