ph-utils 0.16.5 → 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/LICENSE +21 -0
- package/README.md +7 -7
- package/lib/clipboard.d.ts +11 -0
- package/lib/clipboard.js +101 -0
- package/lib/date.js +4 -20
- package/lib/dom.d.ts +28 -1
- package/lib/dom.js +47 -0
- package/package.json +99 -99
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tenny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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.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
|
|
@@ -135,15 +129,7 @@ export function parse(date) {
|
|
|
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,9 +140,7 @@ 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
|
}
|
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/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ph-utils",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"types": "./lib/
|
|
35
|
-
"import": "./lib/
|
|
36
|
-
},
|
|
37
|
-
"./
|
|
38
|
-
"types": "./lib/
|
|
39
|
-
"import": "./lib/
|
|
40
|
-
},
|
|
41
|
-
"./
|
|
42
|
-
"types": "./lib/
|
|
43
|
-
"import": "./lib/
|
|
44
|
-
},
|
|
45
|
-
"./
|
|
46
|
-
"types": "./lib/
|
|
47
|
-
"import": "./lib/
|
|
48
|
-
},
|
|
49
|
-
"./
|
|
50
|
-
"types": "./lib/
|
|
51
|
-
"import": "./lib/
|
|
52
|
-
},
|
|
53
|
-
"./
|
|
54
|
-
"types": "./lib/
|
|
55
|
-
"import": "./lib/
|
|
56
|
-
},
|
|
57
|
-
"./
|
|
58
|
-
"types": "./lib/
|
|
59
|
-
"import": "./lib/
|
|
60
|
-
},
|
|
61
|
-
"./
|
|
62
|
-
"types": "./lib/
|
|
63
|
-
"import": "./lib/
|
|
64
|
-
},
|
|
65
|
-
"./
|
|
66
|
-
"types": "./lib/
|
|
67
|
-
"import": "./lib/
|
|
68
|
-
},
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ph-utils",
|
|
3
|
+
"version": "0.17.1",
|
|
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",
|
|
28
|
+
"main": "lib/index.js",
|
|
29
|
+
"module": "lib/index.js",
|
|
30
|
+
"browser": "lib/index.js",
|
|
31
|
+
"types": "lib/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./lib/index.d.ts",
|
|
35
|
+
"import": "./lib/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./file": {
|
|
38
|
+
"types": "./lib/file.d.ts",
|
|
39
|
+
"import": "./lib/file.js"
|
|
40
|
+
},
|
|
41
|
+
"./date": {
|
|
42
|
+
"types": "./lib/date.d.ts",
|
|
43
|
+
"import": "./lib/date.js"
|
|
44
|
+
},
|
|
45
|
+
"./server": {
|
|
46
|
+
"types": "./lib/server.d.ts",
|
|
47
|
+
"import": "./lib/server.js"
|
|
48
|
+
},
|
|
49
|
+
"./validator": {
|
|
50
|
+
"types": "./lib/validator.d.ts",
|
|
51
|
+
"import": "./lib/validator.js"
|
|
52
|
+
},
|
|
53
|
+
"./crypto": {
|
|
54
|
+
"types": "./lib/crypto.d.ts",
|
|
55
|
+
"import": "./lib/crypto.js"
|
|
56
|
+
},
|
|
57
|
+
"./crypto_node": {
|
|
58
|
+
"types": "./lib/crypto_node.d.ts",
|
|
59
|
+
"import": "./lib/crypto_node.js"
|
|
60
|
+
},
|
|
61
|
+
"./web": {
|
|
62
|
+
"types": "./lib/web.d.ts",
|
|
63
|
+
"import": "./lib/web.js"
|
|
64
|
+
},
|
|
65
|
+
"./dom": {
|
|
66
|
+
"types": "./lib/dom.d.ts",
|
|
67
|
+
"import": "./lib/dom.js"
|
|
68
|
+
},
|
|
69
|
+
"./copy": {
|
|
70
|
+
"types": "./lib/copy.d.ts",
|
|
71
|
+
"import": "./lib/copy.js"
|
|
72
|
+
},
|
|
73
|
+
"./storage": {
|
|
74
|
+
"types": "./lib/storage.d.ts",
|
|
75
|
+
"import": "./lib/storage.js"
|
|
76
|
+
},
|
|
77
|
+
"./color": {
|
|
78
|
+
"types": "./lib/color.d.ts",
|
|
79
|
+
"import": "./lib/color.js"
|
|
80
|
+
},
|
|
81
|
+
"./logger": {
|
|
82
|
+
"types": "./lib/logger.d.ts",
|
|
83
|
+
"import": "./lib/logger.js"
|
|
84
|
+
},
|
|
85
|
+
"./array": {
|
|
86
|
+
"types": "./lib/array.d.ts",
|
|
87
|
+
"import": "./lib/array.js"
|
|
88
|
+
},
|
|
89
|
+
"./theme": {
|
|
90
|
+
"types": "./lib/theme.d.ts",
|
|
91
|
+
"import": "./lib/theme.js"
|
|
92
|
+
},
|
|
93
|
+
"./*": "./lib/*"
|
|
94
|
+
},
|
|
95
|
+
"devDependencies": {
|
|
96
|
+
"@types/node": "^22.8.2",
|
|
97
|
+
"typescript": "^5.6.3"
|
|
98
|
+
}
|
|
99
|
+
}
|