@whitesev/utils 2.6.1 → 2.6.2
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 +674 -0
- package/dist/index.amd.js +1 -1
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +1 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/UtilsGMCookie.d.ts +3 -4
- package/package.json +52 -52
- package/src/Utils.ts +1 -1
- package/src/UtilsGMCookie.ts +4 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UtilsGMCookieDeleteOptions, UtilsGMCookieListOptions, UtilsGMCookieResult, UtilsGMCookieSetOptions, WindowApiOption } from "./types/UtilsGMCookie";
|
|
2
|
-
declare class UtilsGMCookie {
|
|
2
|
+
export declare class UtilsGMCookie {
|
|
3
3
|
private windowApi;
|
|
4
4
|
constructor(windowApiOption?: WindowApiOption);
|
|
5
5
|
/**
|
|
@@ -14,12 +14,12 @@ declare class UtilsGMCookie {
|
|
|
14
14
|
* + cookies object[]
|
|
15
15
|
* + error string|undefined
|
|
16
16
|
**/
|
|
17
|
-
list(option: UtilsGMCookieListOptions, callback?: (data: UtilsGMCookieResult[], error?: Error) => void): void;
|
|
17
|
+
list(option: UtilsGMCookieListOptions | {}, callback?: (data: UtilsGMCookieResult[], error?: Error) => void): void;
|
|
18
18
|
/**
|
|
19
19
|
* 获取多组Cookie
|
|
20
20
|
* @param option 配置
|
|
21
21
|
**/
|
|
22
|
-
getList(option: UtilsGMCookieListOptions): UtilsGMCookieResult[];
|
|
22
|
+
getList(option: UtilsGMCookieListOptions | {}): UtilsGMCookieResult[];
|
|
23
23
|
/**
|
|
24
24
|
* 设置Cookie
|
|
25
25
|
* @param option 配置
|
|
@@ -42,4 +42,3 @@ declare class UtilsGMCookie {
|
|
|
42
42
|
value: string;
|
|
43
43
|
}[];
|
|
44
44
|
}
|
|
45
|
-
export { UtilsGMCookie };
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@whitesev/utils",
|
|
3
|
+
"version": "2.6.2",
|
|
4
|
+
"description": "一个常用的工具库",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"jsdelivr": "dist/index.umd.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./dist/*": "./dist/*",
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.esm.js",
|
|
14
|
+
"require": "./dist/index.cjs.js",
|
|
15
|
+
"types": "./dist/types/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"registry": "https://registry.npmjs.org/"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"typescript",
|
|
27
|
+
"Utils",
|
|
28
|
+
"工具类",
|
|
29
|
+
"TamperMonkey",
|
|
30
|
+
"VioletMonkey",
|
|
31
|
+
"ScriptCat"
|
|
32
|
+
],
|
|
33
|
+
"author": "WhiteSev",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
37
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
38
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
39
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
40
|
+
"rollup-plugin-clear": "^2.0.7",
|
|
41
|
+
"tslib": "^2.6.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"typescript": "^5.5.4"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "rollup --config --watch",
|
|
48
|
+
"build": "rollup --config",
|
|
49
|
+
"build:all": "rollup --config",
|
|
50
|
+
"build:all-new": "rollup --config"
|
|
51
|
+
}
|
|
52
|
+
}
|
package/src/Utils.ts
CHANGED
package/src/UtilsGMCookie.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
} from "./types/UtilsGMCookie";
|
|
8
8
|
import { Utils } from "./Utils";
|
|
9
9
|
|
|
10
|
-
class UtilsGMCookie {
|
|
10
|
+
export class UtilsGMCookie {
|
|
11
11
|
private windowApi = {
|
|
12
12
|
window: window,
|
|
13
13
|
document: document,
|
|
@@ -60,7 +60,7 @@ class UtilsGMCookie {
|
|
|
60
60
|
* + error string|undefined
|
|
61
61
|
**/
|
|
62
62
|
list(
|
|
63
|
-
option: UtilsGMCookieListOptions,
|
|
63
|
+
option: UtilsGMCookieListOptions | {},
|
|
64
64
|
callback?: (data: UtilsGMCookieResult[], error?: Error) => void
|
|
65
65
|
) {
|
|
66
66
|
if (option == null) {
|
|
@@ -114,7 +114,7 @@ class UtilsGMCookie {
|
|
|
114
114
|
* 获取多组Cookie
|
|
115
115
|
* @param option 配置
|
|
116
116
|
**/
|
|
117
|
-
getList(option: UtilsGMCookieListOptions): UtilsGMCookieResult[] {
|
|
117
|
+
getList(option: UtilsGMCookieListOptions | {}): UtilsGMCookieResult[] {
|
|
118
118
|
if (option == null) {
|
|
119
119
|
throw new Error("Utils.GMCookie.list 参数不能为空");
|
|
120
120
|
}
|
|
@@ -226,7 +226,7 @@ class UtilsGMCookie {
|
|
|
226
226
|
/**
|
|
227
227
|
* 解析cookie字符串
|
|
228
228
|
* 例如:document.cookie
|
|
229
|
-
* @param cookieStr
|
|
229
|
+
* @param cookieStr
|
|
230
230
|
*/
|
|
231
231
|
parseCookie(cookieStr: string) {
|
|
232
232
|
let cookies = cookieStr.split(";");
|
|
@@ -245,5 +245,3 @@ class UtilsGMCookie {
|
|
|
245
245
|
return result;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
|
|
249
|
-
export { UtilsGMCookie };
|