Download src/plugin-sdk/test-helpers/import-fresh.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 449 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugin-sdk/test-helpers/import-fresh.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/plugin-sdk/test-helpers/import-fresh.ts
-
curl -L -o import-fresh.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugin-sdk/test-helpers/import-fresh.ts
449 Bytes
| /** Import a module by URL relative to another module, preserving query-string cache busting. */ | |
| export async function importFreshModule<TModule>( | |
| from: string, | |
| specifier: string, | |
| ): Promise<TModule> { | |
| // Vitest keys module instances by the full URL string, including the query | |
| // suffix. These tests rely on that behavior to emulate code-split chunks. | |
| return (await import(/* @vite-ignore */ new URL(specifier, from).href)) as TModule; | |
| } | |