(moduleId: string)
| 100 | * - Removes content in brackets [], parentheses (), and angle brackets <> |
| 101 | */ |
| 102 | export function deobfuscateModuleId(moduleId: string): string { |
| 103 | return ( |
| 104 | moduleId |
| 105 | // Replace [project] with . |
| 106 | .replace(/\[project\]/g, '.') |
| 107 | // Remove content in square brackets (e.g. [app-rsc]) |
| 108 | .replace(/\s\[([^\]]*)\]/g, '') |
| 109 | // Remove content in parentheses (e.g. (ecmascript)) |
| 110 | .replace(/\s\(([^)]*)\)/g, '') |
| 111 | // Remove content in angle brackets (e.g. <locals>) |
| 112 | .replace(/\s<([^>]*)>/g, '') |
| 113 | // Clean up any extra whitespace |
| 114 | .trim() |
| 115 | ) |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Removes the free call wrapper pattern (0, expr) from expressions. |
no test coverage detected