MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / uniqueRtLocal

Function uniqueRtLocal

packages/vite/hmr/helpers/ast-normalizer.ts:66–74  ·  view source on GitHub ↗
(preferred?: string)

Source from the content-addressed store, hash-verified

64 let seq = 0;
65 const makeUid = (hint: string) => `__ns_${hint}_${++seq}`;
66 const uniqueRtLocal = (preferred?: string) => {
67 let name = preferred && !declared.has(preferred) ? preferred : '';
68 if (!name) {
69 let i = 1;
70 while (declared.has(`__ns_rt_ns_${i}`)) i++;
71 name = `__ns_rt_ns_${i}`;
72 }
73 return name;
74 };
75
76 let existingRtImport: t.ImportDeclaration | null = null;
77 let existingRtDefaultLocal: string | null = null;

Callers 2

ImportDeclarationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected