@nickyzj2023/utils 1.0.3 → 1.0.5

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/dom.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 附带时间的 console.log
3
+ * @param args
4
+ *
5
+ * @example
6
+ * timeLog("Hello", "World"); // 14:30:00 Hello World
7
+ */
8
+ export declare const timeLog: (...args: any[]) => void;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from "./network";
2
- export * from "./is";
1
+ export * from "./dom";
2
+ export * from "./is";
3
+ export * from "./network";
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- // @bun
2
- var z=(c)=>{return c?.constructor===Object};class V{cache;maxSize;constructor(c=10){this.cache=new Map,this.maxSize=c}get(c){let a=this.cache.get(c);if(!a)return;return this.cache.delete(c),this.cache.set(c,a),a}set(c,a){if(this.cache.has(c))this.cache.delete(c);else if(this.cache.size>=this.maxSize){let f=[...this.cache.keys()][0];if(f)this.cache.delete(f)}this.cache.set(c,a)}has(c){return this.cache.has(c)}}var g=V;var S=new g,B=(c="")=>{let a=async(f,h={})=>{let e=c?`${c}${f}`:f;if(z(h.body))h.body=JSON.stringify(h.body),h.headers={...h.headers,"Content-Type":"application/json"};let v=()=>fetch(e,h),K;if(!(h.method==="GET"||!h.method))K=v();else{let x=S.get(e);if(!x)x=v(),S.set(e,x);K=x}let d=(await K).clone();if(!d.ok)throw Error(d.statusText);return await d.json()};return{get:(f,h={})=>a(f,{...h,method:"GET"}),post:(f,h,e={})=>a(f,{...e,method:"POST",body:h}),put:(f,h,e={})=>a(f,{...e,method:"PUT",body:h}),delete:(f,h={})=>a(f,{...h,method:"DELETE"})}},C=async(c)=>{try{return[null,await c]}catch(a){return[a,void 0]}};export{C as to,z as isObject,B as fetcher};
1
+ // @bun
2
+ var j=(...c)=>{console.log(`${new Date().toLocaleTimeString()}`,...c)};var l=(c)=>{return c?.constructor===Object};class v{cache;maxSize;constructor(c=10){this.cache=new Map,this.maxSize=c}get(c){let h=this.cache.get(c);if(!h)return;return this.cache.delete(c),this.cache.set(c,h),h}set(c,h){if(this.cache.has(c))this.cache.delete(c);else if(this.cache.size>=this.maxSize){let e=[...this.cache.keys()][0];if(e)this.cache.delete(e)}this.cache.set(c,h)}has(c){return this.cache.has(c)}}var d=v;var z=new d,T=(c="")=>{let h=async(e,a={})=>{let f=c?`${c}${e}`:e;if(l(a.body))a.body=JSON.stringify(a.body),a.headers={...a.headers,"Content-Type":"application/json"};let K=()=>fetch(f,a),g;if(!(a.method==="GET"||!a.method))g=K();else{let x=z.get(f);if(!x)x=K(),z.set(f,x);g=x}let t=(await g).clone();if(!t.ok)throw Error(t.statusText);return await t.json()};return{get:(e,a={})=>h(e,{...a,method:"GET"}),post:(e,a,f={})=>h(e,{...f,method:"POST",body:a}),put:(e,a,f={})=>h(e,{...f,method:"PUT",body:a}),delete:(e,a={})=>h(e,{...a,method:"DELETE"})}},$=async(c)=>{try{return[null,await c]}catch(h){return[h,void 0]}};export{$ as to,j as timeLog,l as isObject,T as fetcher};
package/dist/is.d.ts CHANGED
@@ -1 +1,6 @@
1
- export declare const isObject: (value: any) => value is object;
1
+ /**
2
+ * 检测传入的值是否为**普通对象**
3
+ * @param value
4
+ * @returns {Boolean} 如果是普通对象,返回 true,否则返回 false
5
+ */
6
+ export declare const isObject: (value: any) => value is object;
@@ -1,18 +1,18 @@
1
- /**
2
- * 简易 LRU 缓存
3
- * @example
4
- * const cache = new LRUCache<string, number>(2);
5
- * cache.set("a", 1);
6
- * cache.set("b", 2);
7
- * cache.set("c", 3); // 缓存已满,a 被淘汰
8
- * cache.get("a"); // undefined
9
- */
10
- declare class LRUCache<K, V> {
11
- private cache;
12
- private maxSize;
13
- constructor(maxSize?: number);
14
- get(key: K): V | undefined;
15
- set(key: K, value: V): void;
16
- has(key: K): boolean;
17
- }
18
- export default LRUCache;
1
+ /**
2
+ * 简易 LRU 缓存
3
+ * @example
4
+ * const cache = new LRUCache<string, number>(2);
5
+ * cache.set("a", 1);
6
+ * cache.set("b", 2);
7
+ * cache.set("c", 3); // 缓存已满,a 被淘汰
8
+ * cache.get("a"); // undefined
9
+ */
10
+ declare class LRUCache<K, V> {
11
+ private cache;
12
+ private maxSize;
13
+ constructor(maxSize?: number);
14
+ get(key: K): V | undefined;
15
+ set(key: K, value: V): void;
16
+ has(key: K): boolean;
17
+ }
18
+ export default LRUCache;
package/dist/network.d.ts CHANGED
@@ -1,22 +1,32 @@
1
- /**
2
- * 基于 Fetch API 的请求客户端
3
- * @example
4
- * // 用法1:创建客户端
5
- * const api = fetcher("https://nickyzj.run:3030");
6
- * const res = await api.get<Blog>("/blogs/2025/猩猩也能懂的Node.js部署教程");
7
- *
8
- * // 用法2:直接发送请求
9
- * const res = await fetcher().get<Blog>("https://nickyzj.run:3030/blogs/2025/猩猩也能懂的Node.js部署教程");
10
- */
11
- export declare const fetcher: (baseURL?: string) => {
12
- get: <T>(url: string, options?: Omit<RequestInit, "method">) => Promise<T>;
13
- post: <T>(url: string, body?: any, options?: Omit<RequestInit, "method" | "body">) => Promise<T>;
14
- put: <T>(url: string, body?: any, options?: Omit<RequestInit, "method" | "body">) => Promise<T>;
15
- delete: <T>(url: string, options?: Omit<RequestInit, "method">) => Promise<T>;
16
- };
17
- /**
18
- * Go 语言风格的异步处理方式
19
- * @example
20
- * const [error, response] = await to(request<Resp>("/blogs/2025/猩猩也能懂的Node.js部署教程"));
21
- */
22
- export declare const to: <T, U = Error>(promise: Promise<T>) => Promise<[null, T] | [U, undefined]>;
1
+ /**
2
+ * 基于 Fetch API 的请求客户端
3
+ * @param baseURL 接口前缀,如 https://nickyzj.run:3030,也可以不填
4
+ *
5
+ * @remarks
6
+ * 特性:
7
+ * - 在 body 里直接传递对象
8
+ * - 能够缓存 GET 请求
9
+ *
10
+ * @example
11
+ * // 用法1:创建客户端
12
+ * const api = fetcher("https://nickyzj.run:3030");
13
+ * const res = await api.get<Blog>("/blogs/hello-world");
14
+ *
15
+ * // 用法2:直接发送请求
16
+ * const res = await fetcher().get<Blog>("https://nickyzj.run:3030/blogs/hello-world");
17
+ */
18
+ export declare const fetcher: (baseURL?: string) => {
19
+ get: <T>(url: string, options?: Omit<RequestInit, "method">) => Promise<T>;
20
+ post: <T>(url: string, body?: any, options?: Omit<RequestInit, "method" | "body">) => Promise<T>;
21
+ put: <T>(url: string, body?: any, options?: Omit<RequestInit, "method" | "body">) => Promise<T>;
22
+ delete: <T>(url: string, options?: Omit<RequestInit, "method">) => Promise<T>;
23
+ };
24
+ /**
25
+ * Go 语言风格的异步处理方式
26
+ * @param promise 一个能被 await 的异步函数
27
+ * @returns 如果成功,返回 [null, 异步函数结果],否则返回 [Error, undefined]
28
+ *
29
+ * @example
30
+ * const [error, response] = await to(fetcher().get<Blog>("/blogs/hello-world"));
31
+ */
32
+ export declare const to: <T, Error>(promise: Promise<T>) => Promise<[null, T] | [Error, undefined]>;
@@ -1,85 +1,85 @@
1
- :root {
2
- --light-hl-0: #008000;
3
- --dark-hl-0: #6A9955;
4
- --light-hl-1: #795E26;
5
- --dark-hl-1: #DCDCAA;
6
- --light-hl-2: #000000;
7
- --dark-hl-2: #D4D4D4;
8
- --light-hl-3: #A31515;
9
- --dark-hl-3: #CE9178;
10
- --light-hl-4: #AF00DB;
11
- --dark-hl-4: #CE92A4;
12
- --light-hl-5: #001080;
13
- --dark-hl-5: #9CDCFE;
14
- --light-hl-6: #0000FF;
15
- --dark-hl-6: #569CD6;
16
- --light-hl-7: #0070C1;
17
- --dark-hl-7: #4FC1FF;
18
- --light-hl-8: #267F99;
19
- --dark-hl-8: #4EC9B0;
20
- --light-code-background: #FFFFFF;
21
- --dark-code-background: #1E1E1E;
22
- }
23
-
24
- @media (prefers-color-scheme: light) { :root {
25
- --hl-0: var(--light-hl-0);
26
- --hl-1: var(--light-hl-1);
27
- --hl-2: var(--light-hl-2);
28
- --hl-3: var(--light-hl-3);
29
- --hl-4: var(--light-hl-4);
30
- --hl-5: var(--light-hl-5);
31
- --hl-6: var(--light-hl-6);
32
- --hl-7: var(--light-hl-7);
33
- --hl-8: var(--light-hl-8);
34
- --code-background: var(--light-code-background);
35
- } }
36
-
37
- @media (prefers-color-scheme: dark) { :root {
38
- --hl-0: var(--dark-hl-0);
39
- --hl-1: var(--dark-hl-1);
40
- --hl-2: var(--dark-hl-2);
41
- --hl-3: var(--dark-hl-3);
42
- --hl-4: var(--dark-hl-4);
43
- --hl-5: var(--dark-hl-5);
44
- --hl-6: var(--dark-hl-6);
45
- --hl-7: var(--dark-hl-7);
46
- --hl-8: var(--dark-hl-8);
47
- --code-background: var(--dark-code-background);
48
- } }
49
-
50
- :root[data-theme='light'] {
51
- --hl-0: var(--light-hl-0);
52
- --hl-1: var(--light-hl-1);
53
- --hl-2: var(--light-hl-2);
54
- --hl-3: var(--light-hl-3);
55
- --hl-4: var(--light-hl-4);
56
- --hl-5: var(--light-hl-5);
57
- --hl-6: var(--light-hl-6);
58
- --hl-7: var(--light-hl-7);
59
- --hl-8: var(--light-hl-8);
60
- --code-background: var(--light-code-background);
61
- }
62
-
63
- :root[data-theme='dark'] {
64
- --hl-0: var(--dark-hl-0);
65
- --hl-1: var(--dark-hl-1);
66
- --hl-2: var(--dark-hl-2);
67
- --hl-3: var(--dark-hl-3);
68
- --hl-4: var(--dark-hl-4);
69
- --hl-5: var(--dark-hl-5);
70
- --hl-6: var(--dark-hl-6);
71
- --hl-7: var(--dark-hl-7);
72
- --hl-8: var(--dark-hl-8);
73
- --code-background: var(--dark-code-background);
74
- }
75
-
76
- .hl-0 { color: var(--hl-0); }
77
- .hl-1 { color: var(--hl-1); }
78
- .hl-2 { color: var(--hl-2); }
79
- .hl-3 { color: var(--hl-3); }
80
- .hl-4 { color: var(--hl-4); }
81
- .hl-5 { color: var(--hl-5); }
82
- .hl-6 { color: var(--hl-6); }
83
- .hl-7 { color: var(--hl-7); }
84
- .hl-8 { color: var(--hl-8); }
85
- pre, code { background: var(--code-background); }
1
+ :root {
2
+ --light-hl-0: #008000;
3
+ --dark-hl-0: #6A9955;
4
+ --light-hl-1: #795E26;
5
+ --dark-hl-1: #DCDCAA;
6
+ --light-hl-2: #000000;
7
+ --dark-hl-2: #D4D4D4;
8
+ --light-hl-3: #A31515;
9
+ --dark-hl-3: #CE9178;
10
+ --light-hl-4: #AF00DB;
11
+ --dark-hl-4: #CE92A4;
12
+ --light-hl-5: #001080;
13
+ --dark-hl-5: #9CDCFE;
14
+ --light-hl-6: #0000FF;
15
+ --dark-hl-6: #569CD6;
16
+ --light-hl-7: #0070C1;
17
+ --dark-hl-7: #4FC1FF;
18
+ --light-hl-8: #267F99;
19
+ --dark-hl-8: #4EC9B0;
20
+ --light-code-background: #FFFFFF;
21
+ --dark-code-background: #1E1E1E;
22
+ }
23
+
24
+ @media (prefers-color-scheme: light) { :root {
25
+ --hl-0: var(--light-hl-0);
26
+ --hl-1: var(--light-hl-1);
27
+ --hl-2: var(--light-hl-2);
28
+ --hl-3: var(--light-hl-3);
29
+ --hl-4: var(--light-hl-4);
30
+ --hl-5: var(--light-hl-5);
31
+ --hl-6: var(--light-hl-6);
32
+ --hl-7: var(--light-hl-7);
33
+ --hl-8: var(--light-hl-8);
34
+ --code-background: var(--light-code-background);
35
+ } }
36
+
37
+ @media (prefers-color-scheme: dark) { :root {
38
+ --hl-0: var(--dark-hl-0);
39
+ --hl-1: var(--dark-hl-1);
40
+ --hl-2: var(--dark-hl-2);
41
+ --hl-3: var(--dark-hl-3);
42
+ --hl-4: var(--dark-hl-4);
43
+ --hl-5: var(--dark-hl-5);
44
+ --hl-6: var(--dark-hl-6);
45
+ --hl-7: var(--dark-hl-7);
46
+ --hl-8: var(--dark-hl-8);
47
+ --code-background: var(--dark-code-background);
48
+ } }
49
+
50
+ :root[data-theme='light'] {
51
+ --hl-0: var(--light-hl-0);
52
+ --hl-1: var(--light-hl-1);
53
+ --hl-2: var(--light-hl-2);
54
+ --hl-3: var(--light-hl-3);
55
+ --hl-4: var(--light-hl-4);
56
+ --hl-5: var(--light-hl-5);
57
+ --hl-6: var(--light-hl-6);
58
+ --hl-7: var(--light-hl-7);
59
+ --hl-8: var(--light-hl-8);
60
+ --code-background: var(--light-code-background);
61
+ }
62
+
63
+ :root[data-theme='dark'] {
64
+ --hl-0: var(--dark-hl-0);
65
+ --hl-1: var(--dark-hl-1);
66
+ --hl-2: var(--dark-hl-2);
67
+ --hl-3: var(--dark-hl-3);
68
+ --hl-4: var(--dark-hl-4);
69
+ --hl-5: var(--dark-hl-5);
70
+ --hl-6: var(--dark-hl-6);
71
+ --hl-7: var(--dark-hl-7);
72
+ --hl-8: var(--dark-hl-8);
73
+ --code-background: var(--dark-code-background);
74
+ }
75
+
76
+ .hl-0 { color: var(--hl-0); }
77
+ .hl-1 { color: var(--hl-1); }
78
+ .hl-2 { color: var(--hl-2); }
79
+ .hl-3 { color: var(--hl-3); }
80
+ .hl-4 { color: var(--hl-4); }
81
+ .hl-5 { color: var(--hl-5); }
82
+ .hl-6 { color: var(--hl-6); }
83
+ .hl-7 { color: var(--hl-7); }
84
+ .hl-8 { color: var(--hl-8); }
85
+ pre, code { background: var(--code-background); }
@@ -1,18 +1,18 @@
1
- (function() {
2
- addIcons();
3
- function addIcons() {
4
- if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
5
- const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
6
- svg.innerHTML = `<g id="icon-1" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-2" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-4" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">N</text></g><g id="icon-8" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">E</text></g><g id="icon-16" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-32" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">V</text></g><g id="icon-64" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">F</text></g><g id="icon-128" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-256" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">I</text></g><g id="icon-512" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-1024" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-2048" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-4096" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">F</text></g><g id="icon-8192" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-16384" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-32768" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-65536" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-131072" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-262144" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-524288" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-1048576" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-2097152" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-4194304" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">R</text></g><g id="icon-8388608" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></g><g id="icon-folder" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></g><g id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></g><g id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></g><g id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></g><g id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></g><g id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g><g id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g><g id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></g><g id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g>`;
7
- svg.style.display = "none";
8
- if (location.protocol === "file:") updateUseElements();
9
- }
10
-
11
- function updateUseElements() {
12
- document.querySelectorAll("use").forEach(el => {
13
- if (el.getAttribute("href").includes("#icon-")) {
14
- el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#"));
15
- }
16
- });
17
- }
1
+ (function() {
2
+ addIcons();
3
+ function addIcons() {
4
+ if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
5
+ const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
6
+ svg.innerHTML = `<g id="icon-1" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-2" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-4" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">N</text></g><g id="icon-8" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">E</text></g><g id="icon-16" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-32" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">V</text></g><g id="icon-64" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">F</text></g><g id="icon-128" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-256" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">I</text></g><g id="icon-512" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-1024" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-2048" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">M</text></g><g id="icon-4096" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">F</text></g><g id="icon-8192" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-16384" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">C</text></g><g id="icon-32768" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">P</text></g><g id="icon-65536" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-131072" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-262144" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-524288" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-1048576" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">A</text></g><g id="icon-2097152" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">T</text></g><g id="icon-4194304" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dominant-baseline="central" text-anchor="middle">R</text></g><g id="icon-8388608" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></g><g id="icon-folder" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></g><g id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></g><g id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></g><g id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></g><g id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></g><g id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g><g id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g><g id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></g><g id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g>`;
7
+ svg.style.display = "none";
8
+ if (location.protocol === "file:") updateUseElements();
9
+ }
10
+
11
+ function updateUseElements() {
12
+ document.querySelectorAll("use").forEach(el => {
13
+ if (el.getAttribute("href").includes("#icon-")) {
14
+ el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#"));
15
+ }
16
+ });
17
+ }
18
18
  })()