MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / fetchText

Function fetchText

packages/vite/hmr/client/css-handler.ts:24–42  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

22
23// Fetch helper
24export 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
45export async function handleCssUpdates(cssUpdates: any[], httpOrigin: string): Promise<void> {

Callers 1

handleCssUpdatesFunction · 0.85

Calls 4

warnMethod · 0.80
StringClass · 0.50
textMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected