ph-utils 0.16.4 → 0.17.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/README.md +7 -7
- package/lib/clipboard.d.ts +11 -0
- package/lib/clipboard.js +101 -0
- package/lib/date.d.ts +7 -7
- package/lib/date.js +8 -24
- package/lib/dom.d.ts +28 -1
- package/lib/dom.js +47 -0
- package/lib/theme.js +4 -4
- package/package.json +26 -26
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
## ph-utils
|
|
2
|
-
|
|
3
|
-
整理了 js 前后端开发(web + nodejs)时常用的一些工具;[详细文档](https://gitee.com/towardly/ph/wikis/Home?sort_id=4035190)
|
|
4
|
-
|
|
5
|
-
### 包含如下工具文件
|
|
6
|
-
|
|
7
|
-
`index` 基础工具类、`date` 跟日期相关的工具类、`file` 文件操作相关工具类[**服务端**]、`server` 服务端工具类、`validator` 数据验证、`dom` 浏览器节点操作相关[**前端**]、`web` 一些只适用于前端相关的工具、`color` 颜色相关工具
|
|
1
|
+
## ph-utils
|
|
2
|
+
|
|
3
|
+
整理了 js 前后端开发(web + nodejs)时常用的一些工具;[详细文档](https://gitee.com/towardly/ph/wikis/Home?sort_id=4035190)
|
|
4
|
+
|
|
5
|
+
### 包含如下工具文件
|
|
6
|
+
|
|
7
|
+
`index` 基础工具类、`date` 跟日期相关的工具类、`file` 文件操作相关工具类[**服务端**]、`server` 服务端工具类、`validator` 数据验证、`dom` 浏览器节点操作相关[**前端**]、`web` 一些只适用于前端相关的工具、`color` 颜色相关工具
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 复制数据, 可以从多种类型的数据
|
|
3
|
+
* 1. 直接复制文本: await copy("待复制的文本")
|
|
4
|
+
* 2. 复制节点上的 data-copy-text:
|
|
5
|
+
* <button data-copy-text="这是待复制的文本">复制</button>
|
|
6
|
+
* await copy(e.target) // or await copy("#a") or await copy(document.querySelector('#a'))
|
|
7
|
+
* 3. 直接复制节点本身数据: await copy('#a')
|
|
8
|
+
* @param {string | HTMLElement} source 复制源, 从中解析待复制的数据
|
|
9
|
+
* @returns {Promise<boolean>} 是否复制成功
|
|
10
|
+
*/
|
|
11
|
+
export declare function copy(source: string | HTMLElement): Promise<boolean>;
|
package/lib/clipboard.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建一个临时节点缓存待复制数据
|
|
3
|
+
* @param {String} value - 待复制文本
|
|
4
|
+
* @return {HTMLElement}
|
|
5
|
+
*/
|
|
6
|
+
function createFakeElement(value) {
|
|
7
|
+
const fakeElement = document.createElement("textarea");
|
|
8
|
+
fakeElement.style.border = "0";
|
|
9
|
+
fakeElement.style.padding = "0";
|
|
10
|
+
fakeElement.style.margin = "0";
|
|
11
|
+
fakeElement.style.position = "absolute";
|
|
12
|
+
fakeElement.style.left = "-9999px";
|
|
13
|
+
fakeElement.style.top = "-9999";
|
|
14
|
+
fakeElement.setAttribute("readonly", "");
|
|
15
|
+
fakeElement.value = value;
|
|
16
|
+
return fakeElement;
|
|
17
|
+
}
|
|
18
|
+
/** 通过执行 execCommand 来执行复制 */
|
|
19
|
+
function copyFromCommand(text) {
|
|
20
|
+
// 添加节点
|
|
21
|
+
const fakeEl = createFakeElement(text);
|
|
22
|
+
document.body.append(fakeEl);
|
|
23
|
+
fakeEl.focus();
|
|
24
|
+
fakeEl.select();
|
|
25
|
+
// 执行复制
|
|
26
|
+
const res = document.execCommand("copy");
|
|
27
|
+
fakeEl.remove(); // 删除节点
|
|
28
|
+
return Promise.resolve(res);
|
|
29
|
+
}
|
|
30
|
+
/** 使用 navigator.clipboard 复制 */
|
|
31
|
+
function copyFromClipboard(text) {
|
|
32
|
+
const theClipboard = navigator.clipboard;
|
|
33
|
+
if (theClipboard != null) {
|
|
34
|
+
return theClipboard
|
|
35
|
+
.writeText(text)
|
|
36
|
+
.then(() => {
|
|
37
|
+
Promise.resolve(true);
|
|
38
|
+
})
|
|
39
|
+
.catch(() => Promise.resolve(false));
|
|
40
|
+
}
|
|
41
|
+
return Promise.resolve(false);
|
|
42
|
+
}
|
|
43
|
+
/** 解析待复制的文本 */
|
|
44
|
+
function parseCopyText(source) {
|
|
45
|
+
let copyText = null; // 待复制文本
|
|
46
|
+
let sourceEl = null;
|
|
47
|
+
// 获取待复制数据
|
|
48
|
+
if (typeof source === "string") {
|
|
49
|
+
// 从节点拿数据
|
|
50
|
+
if (source.startsWith("#") || source.startsWith(".")) {
|
|
51
|
+
sourceEl = document.querySelector(source);
|
|
52
|
+
if (sourceEl == null) {
|
|
53
|
+
copyText = source;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
copyText = source;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (source instanceof HTMLElement) {
|
|
61
|
+
sourceEl = source;
|
|
62
|
+
}
|
|
63
|
+
// 从节点获取待复制数据
|
|
64
|
+
if (sourceEl != null) {
|
|
65
|
+
if (sourceEl.hasAttribute("data-copy-text")) {
|
|
66
|
+
copyText = sourceEl.getAttribute("data-copy-text");
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const tagName = sourceEl.tagName;
|
|
70
|
+
if (tagName === "INPUT" || tagName === "TEXTAREA") {
|
|
71
|
+
copyText = sourceEl.value;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
copyText = sourceEl.textContent;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return copyText;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 复制数据, 可以从多种类型的数据
|
|
82
|
+
* 1. 直接复制文本: await copy("待复制的文本")
|
|
83
|
+
* 2. 复制节点上的 data-copy-text:
|
|
84
|
+
* <button data-copy-text="这是待复制的文本">复制</button>
|
|
85
|
+
* await copy(e.target) // or await copy("#a") or await copy(document.querySelector('#a'))
|
|
86
|
+
* 3. 直接复制节点本身数据: await copy('#a')
|
|
87
|
+
* @param {string | HTMLElement} source 复制源, 从中解析待复制的数据
|
|
88
|
+
* @returns {Promise<boolean>} 是否复制成功
|
|
89
|
+
*/
|
|
90
|
+
export async function copy(source) {
|
|
91
|
+
// 待复制文本
|
|
92
|
+
const copyText = parseCopyText(source);
|
|
93
|
+
if (copyText == null) {
|
|
94
|
+
return Promise.resolve(false);
|
|
95
|
+
}
|
|
96
|
+
const v = await copyFromClipboard(copyText);
|
|
97
|
+
if (v === false) {
|
|
98
|
+
return copyFromCommand(copyText);
|
|
99
|
+
}
|
|
100
|
+
return Promise.resolve(true);
|
|
101
|
+
}
|
package/lib/date.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 将日期格式化为指定形式的字符串
|
|
3
3
|
* @param date 日期
|
|
4
|
-
* @param pattern 格式化字符串 yyyy - 年, mm - 月, dd - 日, HH -
|
|
4
|
+
* @param pattern 格式化字符串 yyyy - 年, mm - 月, dd - 日, HH - 小时(24时制), MM - 分钟, ss - 秒, S - 毫秒, 默认: yyyy-mm-dd HH:MM:ss
|
|
5
5
|
*/
|
|
6
6
|
export declare function format(date?: Date | string | number | null, pattern?: string): string;
|
|
7
7
|
/**
|
|
@@ -13,24 +13,24 @@ export declare function parse(date?: Date | string | number | null): Date;
|
|
|
13
13
|
/**
|
|
14
14
|
* 设置日期的开始或者结束的点
|
|
15
15
|
* @param date 日期,能够被 parse 解析的日期
|
|
16
|
-
* @param unit 单位,Date
|
|
16
|
+
* @param unit 单位,Date[D]、Minute[M], 默认为 Date
|
|
17
17
|
* @param isEnd true则为 endOf
|
|
18
18
|
*/
|
|
19
|
-
export declare function dateOf(date?: Date | string | number, unit?: string, isEnd?: boolean): Date;
|
|
19
|
+
export declare function dateOf(date?: Date | string | number | null, unit?: string, isEnd?: boolean): Date;
|
|
20
20
|
/**
|
|
21
21
|
* 设置日期的开始的点
|
|
22
22
|
* @param date 日期,能够被 parse 解析的日期
|
|
23
|
-
* @param unit 单位,Date
|
|
23
|
+
* @param unit 单位,Date[D]、Minute[M], 默认为 Date
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
export declare function startOf(date?: Date | string | number, unit?: string): Date;
|
|
26
|
+
export declare function startOf(date?: Date | string | number | null, unit?: string): Date;
|
|
27
27
|
/**
|
|
28
28
|
* 设置日期的结束点
|
|
29
29
|
* @param date 日期,能够被 parse 解析的日期
|
|
30
|
-
* @param unit 单位,Date
|
|
30
|
+
* @param unit 单位,Date[D]、Minute[M], 默认为 Date
|
|
31
31
|
* @returns
|
|
32
32
|
*/
|
|
33
|
-
export declare function endOf(date?: Date | string | number, unit?: string): Date;
|
|
33
|
+
export declare function endOf(date?: Date | string | number | null, unit?: string): Date;
|
|
34
34
|
/**
|
|
35
35
|
* 获取时间戳
|
|
36
36
|
* @param ctime 时间
|
package/lib/date.js
CHANGED
|
@@ -12,17 +12,11 @@ const ofArgs = {
|
|
|
12
12
|
const units = {
|
|
13
13
|
Date: ["date", "Date", "day", "Day", "D", "d"],
|
|
14
14
|
Month: ["Month", "month", "m"],
|
|
15
|
-
|
|
15
|
+
FullYear: ["Year", "year", "y"],
|
|
16
16
|
Hours: ["Hours", "hours", "H"],
|
|
17
17
|
Minutes: ["Minutes", "Minute", "minute", "minutes", "M"],
|
|
18
18
|
Seconds: ["Seconds", "seconds", "Second", "second", "s"],
|
|
19
|
-
Milliseconds: [
|
|
20
|
-
"Milliseconds",
|
|
21
|
-
"Millisecond",
|
|
22
|
-
"milliseconds",
|
|
23
|
-
"illisecond",
|
|
24
|
-
"S",
|
|
25
|
-
],
|
|
19
|
+
Milliseconds: ["Milliseconds", "Millisecond", "milliseconds", "illisecond", "S"],
|
|
26
20
|
};
|
|
27
21
|
/**
|
|
28
22
|
* 不足位数, 前位补 0
|
|
@@ -72,7 +66,7 @@ function getLastDayOfMonth(date, month) {
|
|
|
72
66
|
/**
|
|
73
67
|
* 将日期格式化为指定形式的字符串
|
|
74
68
|
* @param date 日期
|
|
75
|
-
* @param pattern 格式化字符串 yyyy - 年, mm - 月, dd - 日, HH -
|
|
69
|
+
* @param pattern 格式化字符串 yyyy - 年, mm - 月, dd - 日, HH - 小时(24时制), MM - 分钟, ss - 秒, S - 毫秒, 默认: yyyy-mm-dd HH:MM:ss
|
|
76
70
|
*/
|
|
77
71
|
export function format(date, pattern = "yyyy-mm-dd HH:MM:ss") {
|
|
78
72
|
// eslint-disable-next-line
|
|
@@ -130,20 +124,12 @@ export function parse(date) {
|
|
|
130
124
|
/**
|
|
131
125
|
* 设置日期的开始或者结束的点
|
|
132
126
|
* @param date 日期,能够被 parse 解析的日期
|
|
133
|
-
* @param unit 单位,Date
|
|
127
|
+
* @param unit 单位,Date[D]、Minute[M], 默认为 Date
|
|
134
128
|
* @param isEnd true则为 endOf
|
|
135
129
|
*/
|
|
136
130
|
export function dateOf(date, unit, isEnd = false) {
|
|
137
131
|
/* 如果是设置某一天的开始时刻, 就需要将时、分、秒、毫秒设置为0,依次类推设置 */
|
|
138
|
-
const periods = [
|
|
139
|
-
"Year",
|
|
140
|
-
"Month",
|
|
141
|
-
"Date",
|
|
142
|
-
"Hours",
|
|
143
|
-
"Minutes",
|
|
144
|
-
"Seconds",
|
|
145
|
-
"Milliseconds",
|
|
146
|
-
];
|
|
132
|
+
const periods = ["Year", "Month", "Date", "Hours", "Minutes", "Seconds", "Milliseconds"];
|
|
147
133
|
let index = periods.indexOf(getUnit(unit || "Date"));
|
|
148
134
|
const clone = parse(date);
|
|
149
135
|
index++;
|
|
@@ -154,16 +140,14 @@ export function dateOf(date, unit, isEnd = false) {
|
|
|
154
140
|
// 设置为某个月的最后一天的日期
|
|
155
141
|
value = getLastDayOfMonth(clone);
|
|
156
142
|
}
|
|
157
|
-
Date.prototype["set" + periods[index]].apply(clone, [
|
|
158
|
-
setValues[index],
|
|
159
|
-
]);
|
|
143
|
+
Date.prototype["set" + periods[index]].apply(clone, [setValues[index]]);
|
|
160
144
|
}
|
|
161
145
|
return clone;
|
|
162
146
|
}
|
|
163
147
|
/**
|
|
164
148
|
* 设置日期的开始的点
|
|
165
149
|
* @param date 日期,能够被 parse 解析的日期
|
|
166
|
-
* @param unit 单位,Date
|
|
150
|
+
* @param unit 单位,Date[D]、Minute[M], 默认为 Date
|
|
167
151
|
* @returns
|
|
168
152
|
*/
|
|
169
153
|
export function startOf(date, unit) {
|
|
@@ -172,7 +156,7 @@ export function startOf(date, unit) {
|
|
|
172
156
|
/**
|
|
173
157
|
* 设置日期的结束点
|
|
174
158
|
* @param date 日期,能够被 parse 解析的日期
|
|
175
|
-
* @param unit 单位,Date
|
|
159
|
+
* @param unit 单位,Date[D]、Minute[M], 默认为 Date
|
|
176
160
|
* @returns
|
|
177
161
|
*/
|
|
178
162
|
export function endOf(date, unit) {
|
package/lib/dom.d.ts
CHANGED
|
@@ -119,7 +119,7 @@ export declare function html(element: HTMLElement, htmlstr?: string): string | u
|
|
|
119
119
|
* @param textstr 可选,如果传递该参数,则表示设置;否则表示获取
|
|
120
120
|
* @returns
|
|
121
121
|
*/
|
|
122
|
-
export declare function text(element: HTMLElement, textstr?: string): string | undefined;
|
|
122
|
+
export declare function text(element: HTMLElement, textstr?: string): string | undefined | null;
|
|
123
123
|
export declare function iterate<T>(elems: T[], fn: (el: T, index: number) => any): void;
|
|
124
124
|
export declare function iterate(elems: NodeList | HTMLCollection | NodeListOf<HTMLElement>, fn: (el: HTMLElement, index: number) => any): void;
|
|
125
125
|
/**
|
|
@@ -222,4 +222,31 @@ export declare function formatStyle(styleObj: FormatStyleParam): string;
|
|
|
222
222
|
* transition($el, [["opacity", "0", "0.3s"]], "leave", () => { $el.remove(); });
|
|
223
223
|
*/
|
|
224
224
|
export declare function transition(el: HTMLElement, nameOrProperties: string | [string, string, string][], dir?: "leave" | "enter", finish?: () => void): void;
|
|
225
|
+
/**
|
|
226
|
+
* 计算光标位置
|
|
227
|
+
*
|
|
228
|
+
* 根据输入值的变化计算新的光标位置,主要用于输入框内容变化时的光标位置调整
|
|
229
|
+
*
|
|
230
|
+
* @param start - 光标起始位置,通常为: input.selectionStart
|
|
231
|
+
* @param end - 光标结束位置(通常与起始位置相同,用于选择范围),通常为: input.selectionEnd
|
|
232
|
+
* @param oldValue - 变化前的值
|
|
233
|
+
* @param newValue - 变化后的值
|
|
234
|
+
* @returns 新的光标位置对象,包含新的起始和结束位置
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* // 删除字符时,光标向前移动
|
|
238
|
+
* calcuteCursorPosition(2, 2, "abc", "ac"); // 返回 { start: 1, end: 1 }
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* // 添加字符时,光标向后移动
|
|
242
|
+
* calcuteCursorPosition(2, 2, "ac", "abc"); // 返回 { start: 3, end: 3 }
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* // 替换字符时,保持位置
|
|
246
|
+
* calcuteCursorPosition(2, 2, "abc", "axc"); // 返回 { start: 2, end: 2 }
|
|
247
|
+
*/
|
|
248
|
+
export declare function calcuteCursorPosition(start: number, end: number, oldValue: string, newValue: string): {
|
|
249
|
+
start: number;
|
|
250
|
+
end: number;
|
|
251
|
+
};
|
|
225
252
|
export {};
|
package/lib/dom.js
CHANGED
|
@@ -550,3 +550,50 @@ export function transition(el, nameOrProperties, dir = "enter", finish) {
|
|
|
550
550
|
}
|
|
551
551
|
}, { once: true });
|
|
552
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* 计算光标位置
|
|
555
|
+
*
|
|
556
|
+
* 根据输入值的变化计算新的光标位置,主要用于输入框内容变化时的光标位置调整
|
|
557
|
+
*
|
|
558
|
+
* @param start - 光标起始位置,通常为: input.selectionStart
|
|
559
|
+
* @param end - 光标结束位置(通常与起始位置相同,用于选择范围),通常为: input.selectionEnd
|
|
560
|
+
* @param oldValue - 变化前的值
|
|
561
|
+
* @param newValue - 变化后的值
|
|
562
|
+
* @returns 新的光标位置对象,包含新的起始和结束位置
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
* // 删除字符时,光标向前移动
|
|
566
|
+
* calcuteCursorPosition(2, 2, "abc", "ac"); // 返回 { start: 1, end: 1 }
|
|
567
|
+
*
|
|
568
|
+
* @example
|
|
569
|
+
* // 添加字符时,光标向后移动
|
|
570
|
+
* calcuteCursorPosition(2, 2, "ac", "abc"); // 返回 { start: 3, end: 3 }
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* // 替换字符时,保持位置
|
|
574
|
+
* calcuteCursorPosition(2, 2, "abc", "axc"); // 返回 { start: 2, end: 2 }
|
|
575
|
+
*/
|
|
576
|
+
export function calcuteCursorPosition(start, end, oldValue, newValue) {
|
|
577
|
+
// 5. 【关键】计算新光标位置并恢复
|
|
578
|
+
let newStart = start;
|
|
579
|
+
let newEnd = end;
|
|
580
|
+
// 简单策略:如果新值比旧值短,说明删了字符,光标前移
|
|
581
|
+
// 更健壮的做法:对比差异,但通常可简化处理
|
|
582
|
+
if (newValue.length < oldValue.length) {
|
|
583
|
+
// 例如:用户在中间删了一个非法字符
|
|
584
|
+
newStart = Math.max(0, start - (oldValue.length - newValue.length));
|
|
585
|
+
newEnd = newStart;
|
|
586
|
+
}
|
|
587
|
+
else if (newValue.length > oldValue.length) {
|
|
588
|
+
// 插入合法字符,光标通常就在插入点后,可保持原偏移
|
|
589
|
+
// 但需防止超出长度
|
|
590
|
+
newStart = Math.min(newValue.length, start + (newValue.length - oldValue.length));
|
|
591
|
+
newEnd = newStart;
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
// 长度不变(如替换),保持原位置(但要限制范围)
|
|
595
|
+
newStart = Math.min(newValue.length, start);
|
|
596
|
+
newEnd = newStart;
|
|
597
|
+
}
|
|
598
|
+
return { start: newStart, end: newEnd };
|
|
599
|
+
}
|
package/lib/theme.js
CHANGED
|
@@ -19,10 +19,10 @@ export async function initTheme() {
|
|
|
19
19
|
if ($themeStyle == null) {
|
|
20
20
|
$themeStyle = document.createElement("style");
|
|
21
21
|
$themeStyle.id = "theme-style";
|
|
22
|
-
$themeStyle.innerHTML = `
|
|
23
|
-
:root{color-scheme:light dark;}
|
|
24
|
-
html.light{color-scheme: light;}
|
|
25
|
-
html.dark {color-scheme: dark;}
|
|
22
|
+
$themeStyle.innerHTML = `
|
|
23
|
+
:root{color-scheme:light dark;}
|
|
24
|
+
html.light{color-scheme: light;}
|
|
25
|
+
html.dark {color-scheme: dark;}
|
|
26
26
|
`;
|
|
27
27
|
document.head.appendChild($themeStyle);
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ph-utils",
|
|
3
|
+
"version": "0.17.1",
|
|
3
4
|
"description": "js 开发工具集,前后端都可以使用(commonjs和es module)",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"date",
|
|
7
|
+
"dom",
|
|
8
|
+
"file",
|
|
9
|
+
"javascript",
|
|
10
|
+
"node",
|
|
11
|
+
"utils"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://gitee.com/towardly/ph/tree/master/packages/utils",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://gitee.com/towardly/ph/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Tenny <tenny.shu@foxmail.com>",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https//gitee.com/towardly/ph.git",
|
|
22
|
+
"directory": "packages/utils"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"lib"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
4
28
|
"main": "lib/index.js",
|
|
5
29
|
"module": "lib/index.js",
|
|
6
|
-
"types": "lib/index.d.ts",
|
|
7
30
|
"browser": "lib/index.js",
|
|
31
|
+
"types": "lib/index.d.ts",
|
|
8
32
|
"exports": {
|
|
9
33
|
".": {
|
|
10
34
|
"types": "./lib/index.d.ts",
|
|
@@ -68,32 +92,8 @@
|
|
|
68
92
|
},
|
|
69
93
|
"./*": "./lib/*"
|
|
70
94
|
},
|
|
71
|
-
"version": "0.16.4",
|
|
72
|
-
"type": "module",
|
|
73
|
-
"repository": {
|
|
74
|
-
"type": "git",
|
|
75
|
-
"url": "git+https//gitee.com/towardly/ph.git",
|
|
76
|
-
"directory": "packages/utils"
|
|
77
|
-
},
|
|
78
|
-
"license": "MIT",
|
|
79
|
-
"author": "Tenny <tenny.shu@foxmail.com>",
|
|
80
|
-
"bugs": {
|
|
81
|
-
"url": "https://gitee.com/towardly/ph/issues"
|
|
82
|
-
},
|
|
83
|
-
"homepage": "https://gitee.com/towardly/ph/tree/master/packages/utils",
|
|
84
95
|
"devDependencies": {
|
|
85
96
|
"@types/node": "^22.8.2",
|
|
86
97
|
"typescript": "^5.6.3"
|
|
87
|
-
}
|
|
88
|
-
"files": [
|
|
89
|
-
"lib"
|
|
90
|
-
],
|
|
91
|
-
"keywords": [
|
|
92
|
-
"node",
|
|
93
|
-
"utils",
|
|
94
|
-
"javascript",
|
|
95
|
-
"date",
|
|
96
|
-
"dom",
|
|
97
|
-
"file"
|
|
98
|
-
]
|
|
98
|
+
}
|
|
99
99
|
}
|