()
| 19 | |
| 20 | // p-limit 是 ESM-only,必须动态加载 |
| 21 | let pLimit: typeof import("p-limit").default; |
| 22 | let pLimitReady: Promise<void> | null = null; |
| 23 | async function ensurePLimit(): Promise<typeof pLimit> { |
| 24 | if (pLimit) return pLimit; |
| 25 | if (!pLimitReady) { |
| 26 | pLimitReady = (async () => { |
| 27 | try { |
| 28 | npm_install("p-limit"); |
| 29 | } catch {} |
| 30 | pLimit = (await import("p-limit")).default; |
| 31 | })(); |
| 32 | } |
| 33 | await pLimitReady; |
| 34 | return pLimit; |
| 35 | } |
| 36 |
no outgoing calls
no test coverage detected