(url: string)
| 22 | |
| 23 | // Fetch helper |
| 24 | export async function fetchText(url: string): Promise<string> { |
| 25 | try { |
| 26 | const g = globalThis as any; |
| 27 | if (typeof g.fetch === 'function') { |
| 28 | const res = await g.fetch(url); |
| 29 | return await res.text(); |
| 30 | } |
| 31 | // Fallback to NativeScript Http if available |
| 32 | const Http = g.Http; |
| 33 | if (Http && Http.getString) { |
| 34 | return await Http.getString(url); |
| 35 | } |
| 36 | if (VERBOSE) console.warn('[ns-hmr] No fetch method available'); |
| 37 | return ''; |
| 38 | } catch (e) { |
| 39 | console.warn('[ns-hmr] Fetch failed:', e?.message || String(e)); |
| 40 | return ''; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // Handle CSS updates from Vite |
| 45 | export async function handleCssUpdates(cssUpdates: any[], httpOrigin: string): Promise<void> { |
no test coverage detected