(raw: string)
| 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++) { |
no test coverage detected