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

Function normalizeGraphId

packages/vite/hmr/server/websocket.ts:2235–2251  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

2233 return ordered;
2234 }
2235 function normalizeGraphId(raw: string): string {
2236 if (!raw) return raw;
2237 let id = raw.split('?')[0].replace(/\\/g, '/');
2238 // Strip file:// prefix
2239 id = id.replace(/^file:\/\//, '');
2240 if (pluginRoot) {
2241 const rootNorm = pluginRoot.replace(/\\/g, '/');
2242 if (id.startsWith(rootNorm)) {
2243 id = id.slice(rootNorm.length);
2244 }
2245 }
2246 if (!id.startsWith('/')) id = '/' + id;
2247 // Collapse nested app root indicators when present (defensive)
2248 const idx = id.indexOf(APP_VIRTUAL_WITH_SLASH);
2249 if (idx !== -1) id = id.slice(idx);
2250 return id;
2251 }
2252 function computeHash(content: string): string {
2253 let h = 0;
2254 for (let i = 0; i < content.length; i++) {

Callers 2

upsertGraphModuleFunction · 0.85
handleHotUpdateFunction · 0.85

Calls 3

replaceMethod · 0.80
indexOfMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected