(importPath: string)
| 163 | export const normalizeFsPath = (p: string) => normalizePath(p.split('?')[0].replace(/\0/g, '')); |
| 164 | |
| 165 | export const normalizeFsPathQuery = (importPath: string) => { |
| 166 | const pathParts = importPath.split('?'); |
| 167 | const filePath = normalizePath(pathParts[0]); |
| 168 | const filePathParts = filePath.split('.'); |
| 169 | const ext = filePathParts.length > 1 ? filePathParts.pop()!.toLowerCase() : null; |
| 170 | const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null; |
| 171 | const format = params ? params.get('format') : null; |
| 172 | |
| 173 | return { |
| 174 | filePath, |
| 175 | ext, |
| 176 | format, |
| 177 | }; |
| 178 | }; |
| 179 | |
| 180 | const enum CharacterCodes { |
| 181 | a = 0x61, |
no test coverage detected