rn-iconify 2.1.0 → 2.1.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/lib/commonjs/cache/CacheManager.js +13 -1
- package/lib/commonjs/cache/CacheManager.js.map +1 -1
- package/lib/commonjs/cache/DiskCache.js +33 -4
- package/lib/commonjs/cache/DiskCache.js.map +1 -1
- package/lib/commonjs/cli/CLAUDE.md +7 -0
- package/lib/commonjs/cli/commands/bundle.js +37 -6
- package/lib/commonjs/cli/commands/bundle.js.map +1 -1
- package/lib/commonjs/network/IconifyAPI.js +30 -2
- package/lib/commonjs/network/IconifyAPI.js.map +1 -1
- package/lib/module/cache/CacheManager.js +13 -1
- package/lib/module/cache/CacheManager.js.map +1 -1
- package/lib/module/cache/DiskCache.js +32 -4
- package/lib/module/cache/DiskCache.js.map +1 -1
- package/lib/module/cli/CLAUDE.md +7 -0
- package/lib/module/cli/commands/bundle.js +37 -6
- package/lib/module/cli/commands/bundle.js.map +1 -1
- package/lib/module/network/IconifyAPI.js +30 -2
- package/lib/module/network/IconifyAPI.js.map +1 -1
- package/lib/typescript/cache/CacheManager.d.ts.map +1 -1
- package/lib/typescript/cache/DiskCache.d.ts +2 -0
- package/lib/typescript/cache/DiskCache.d.ts.map +1 -1
- package/lib/typescript/cli/commands/bundle.d.ts.map +1 -1
- package/lib/typescript/components/Charm.d.ts +1 -1
- package/lib/typescript/components/Dashicons.d.ts +1 -1
- package/lib/typescript/components/Hugeicons.d.ts +1 -1
- package/lib/typescript/components/Ix.d.ts +1 -1
- package/lib/typescript/components/Tabler.d.ts +1 -1
- package/lib/typescript/components/Token.d.ts +1 -1
- package/lib/typescript/components/TokenBranded.d.ts +1 -1
- package/lib/typescript/network/IconifyAPI.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/cache/CacheManager.ts +14 -1
- package/src/cache/DiskCache.ts +43 -4
- package/src/cli/CLAUDE.md +7 -0
- package/src/cli/commands/bundle.ts +52 -6
- package/src/network/IconifyAPI.ts +23 -1
|
@@ -62,19 +62,41 @@ async function fetchWithTimeout(
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Combine multiple AbortSignals into one
|
|
65
|
+
* Properly cleans up event listeners to prevent memory leaks
|
|
65
66
|
*/
|
|
66
67
|
function anySignal(signals: AbortSignal[]): AbortSignal {
|
|
67
68
|
const controller = new AbortController();
|
|
68
69
|
|
|
70
|
+
// Check if any signal is already aborted
|
|
69
71
|
for (const signal of signals) {
|
|
70
72
|
if (signal.aborted) {
|
|
71
73
|
controller.abort();
|
|
72
74
|
return controller.signal;
|
|
73
75
|
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Create abort handlers that we can clean up
|
|
79
|
+
const abortHandlers: Array<{ signal: AbortSignal; handler: () => void }> = [];
|
|
80
|
+
|
|
81
|
+
const cleanup = () => {
|
|
82
|
+
for (const { signal, handler } of abortHandlers) {
|
|
83
|
+
signal.removeEventListener('abort', handler);
|
|
84
|
+
}
|
|
85
|
+
abortHandlers.length = 0;
|
|
86
|
+
};
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
for (const signal of signals) {
|
|
89
|
+
const handler = () => {
|
|
90
|
+
cleanup();
|
|
91
|
+
controller.abort();
|
|
92
|
+
};
|
|
93
|
+
abortHandlers.push({ signal, handler });
|
|
94
|
+
signal.addEventListener('abort', handler);
|
|
76
95
|
}
|
|
77
96
|
|
|
97
|
+
// Also cleanup when our controller aborts (from timeout)
|
|
98
|
+
controller.signal.addEventListener('abort', cleanup, { once: true });
|
|
99
|
+
|
|
78
100
|
return controller.signal;
|
|
79
101
|
}
|
|
80
102
|
|