tcdona_unilib 1.0.11 → 1.0.14
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/.prettierrc.json +6 -0
- package/animejs.ts +13 -1
- package/ast-grep.ts +42 -0
- package/big.ts +2 -2
- package/clipboardy.ts +1 -1
- package/dayjs.ts +2 -2
- package/dotenvx.ts +15 -2
- package/eff/aff.ts +161 -0
- package/eff/aff.util.ts +218 -0
- package/eff/eff.delay.ts +21 -0
- package/eff/eff.ts +225 -0
- package/eff/effcan.ts +286 -0
- package/eff/throwable.ts +11 -0
- package/effector.ts +33 -2
- package/es-toolkit.ts +1 -7
- package/exome.ts +10 -2
- package/hono.ts +18 -2
- package/hotkeys-js.ts +3 -2
- package/idmeta.json +42 -0
- package/inquirer.ts +1 -1
- package/koka/async.ts +2 -7
- package/koka/ctx.ts +2 -9
- package/koka/err.ts +2 -9
- package/koka/gen.ts +2 -9
- package/koka/index.ts +1 -1
- package/koka/opt.ts +2 -7
- package/koka/result.ts +6 -9
- package/koka/task.ts +2 -8
- package/koka-domain.ts +13 -16
- package/koka.ts +29 -34
- package/magic-regexp.ts +28 -2
- package/marked.ts +28 -2
- package/nanoid.ts +7 -1
- package/nanostores.ts +31 -2
- package/neverthrow.ts +2 -2
- package/package.json +24 -33
- package/pathe.ts +16 -1
- package/pinyin-pro.ts +16 -2
- package/prettier.ts +20 -2
- package/staticMeta/enum.api.ts +111 -82
- package/staticMeta/err.ts +64 -0
- package/staticMeta/file.yml.ts +22 -13
- package/staticMeta/md.html2md.ts +38 -0
- package/staticMeta/md.md2html.ts +203 -0
- package/staticMeta/path.init.ts +12 -12
- package/staticMeta/string.nanoid.ts +7 -7
- package/staticMeta/url.ts +57 -54
- package/tinypool.ts +29 -2
- package/turndown.ts +1 -1
- package/vite.ts +2 -2
- package/viteplugin/md.plugin.dist.d.ts +18 -0
- package/viteplugin/md.plugin.dist.js +1133 -0
- package/viteplugin/md.plugin.ts +22 -0
- package/viteplugin/vite-env.d.ts +6 -0
- package/viteplugin/vite.config.ts +62 -0
- package/vue.ts +2 -12
- package/zod.ts +19 -2
- package/zx.ts +25 -1
- package/@ast-grep.ts +0 -18
- package/comctx.ts +0 -2
- package/hono/cors.ts +0 -1
- package/hono/logger.ts +0 -1
- package/hono/timeout.ts +0 -1
- package/staticMeta/ast.scan.ts +0 -131
- package/staticMeta/ast.ts +0 -259
- package/staticMeta/eff.delay.ts +0 -17
- package/staticMeta/eff.ts +0 -203
- package/staticMeta/iduniq.ts +0 -320
- package/staticMeta/idupdate.ts +0 -374
- package/staticMeta/pkg.json.ts +0 -138
- package/staticMeta/project.ts +0 -98
- package/staticMeta/sync.ts +0 -296
package/staticMeta/url.ts
CHANGED
|
@@ -6,81 +6,84 @@
|
|
|
6
6
|
* 基于 base 和相对路径构造完整 URL,支持查询参数和 hash
|
|
7
7
|
*/
|
|
8
8
|
export const buildUrl = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
base: string,
|
|
10
|
+
path: string,
|
|
11
|
+
params: Record<string, any> = {},
|
|
12
|
+
hash?: string,
|
|
13
13
|
) => {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const url = new URL(path, base) // path 可为相对/绝对
|
|
15
|
+
const sp = url.searchParams
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
17
|
+
// 删除/增查参数 (会自动编码)
|
|
18
|
+
for (const [k, v] of Object.entries(params)) {
|
|
19
|
+
if (v === undefined || v === null) {
|
|
20
|
+
sp.delete(k)
|
|
21
|
+
} else if (Array.isArray(v)) {
|
|
22
|
+
sp.delete(k)
|
|
23
|
+
v.forEach((item: any) => sp.append(k, String(item)))
|
|
24
|
+
} else {
|
|
25
|
+
sp.set(k, String(v))
|
|
27
26
|
}
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (hash !== undefined) url.hash = hash // 哈希 "#top" (可能不带)
|
|
30
|
+
return url.toString()
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* 改写现有 URL 的查询参数和 hash(支持设置、追加、删除参数)
|
|
35
35
|
*/
|
|
36
36
|
export const rewriteUrl = (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
input: string,
|
|
38
|
+
{
|
|
39
|
+
set = {},
|
|
40
|
+
append = {},
|
|
41
|
+
del = [],
|
|
42
|
+
hash,
|
|
43
|
+
}: {
|
|
44
|
+
set?: Record<string, any>
|
|
45
|
+
append?: Record<string, any>
|
|
46
|
+
del?: string[]
|
|
47
|
+
hash?: string
|
|
48
|
+
} = {},
|
|
49
49
|
) => {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const url = new URL(input)
|
|
51
|
+
const sp = url.searchParams
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
// 设置参数
|
|
54
|
+
for (const [k, v] of Object.entries(set)) {
|
|
55
|
+
if (v === undefined || v === null) sp.delete(k)
|
|
56
|
+
else sp.set(k, String(v))
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// 追加参数
|
|
60
|
+
for (const [k, v] of Object.entries(append)) {
|
|
61
|
+
if (Array.isArray(v)) v.forEach((item: any) => sp.append(k, String(item)))
|
|
62
|
+
else sp.append(k, String(v))
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// del: 删除参数
|
|
66
|
+
del.forEach((k) => sp.delete(k))
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
if (hash !== undefined) url.hash = hash
|
|
69
|
+
return url.toString()
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* 合并查询参数字符串和参数对象
|
|
74
74
|
*/
|
|
75
|
-
export const mergeQueryString = (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
export const mergeQueryString = (
|
|
76
|
+
search: string,
|
|
77
|
+
path: Record<string, any> = {},
|
|
78
|
+
) => {
|
|
79
|
+
const sp = new URLSearchParams(search) // 符合 "?a=1" 或 "a=1"
|
|
80
|
+
for (const [k, v] of Object.entries(path)) {
|
|
81
|
+
if (v === undefined || v === null) sp.delete(k)
|
|
82
|
+
else sp.set(k, String(v))
|
|
83
|
+
}
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
const qs = sp.toString()
|
|
86
|
+
return qs ? `?${qs}` : ''
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
// export const tz = async () => {
|
package/tinypool.ts
CHANGED
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
isMovable,
|
|
3
|
+
isTaskQueue,
|
|
4
|
+
isTransferable,
|
|
5
|
+
kFieldCount,
|
|
6
|
+
kQueueOptions,
|
|
7
|
+
kRequestCountField,
|
|
8
|
+
kResponseCountField,
|
|
9
|
+
kTransferable,
|
|
10
|
+
kValue,
|
|
11
|
+
markMovable,
|
|
12
|
+
workerId,
|
|
13
|
+
Tinypool,
|
|
14
|
+
} from 'tinypool'
|
|
15
|
+
export type {
|
|
16
|
+
Options,
|
|
17
|
+
ReadyMessage,
|
|
18
|
+
RequestMessage,
|
|
19
|
+
ResponseMessage,
|
|
20
|
+
StartupMessage,
|
|
21
|
+
Task,
|
|
22
|
+
TaskQueue,
|
|
23
|
+
TinypoolChannel,
|
|
24
|
+
TinypoolData,
|
|
25
|
+
TinypoolPrivateData,
|
|
26
|
+
TinypoolWorker,
|
|
27
|
+
TinypoolWorkerMessage,
|
|
28
|
+
Transferable,
|
|
29
|
+
} from 'tinypool'
|
package/turndown.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as TurndownService } from 'turndown'
|
|
1
|
+
export { default as TurndownService } from 'turndown'
|
package/vite.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Vite plugin for transforming Markdown files
|
|
5
|
+
*/
|
|
6
|
+
export declare function myMdPlugin(): {
|
|
7
|
+
name: string
|
|
8
|
+
transform: (
|
|
9
|
+
src: string,
|
|
10
|
+
id: string,
|
|
11
|
+
) => Promise<
|
|
12
|
+
| {
|
|
13
|
+
code: string
|
|
14
|
+
map: null
|
|
15
|
+
}
|
|
16
|
+
| undefined
|
|
17
|
+
>
|
|
18
|
+
}
|