* Normalizes a path to use forward slashes, removes trailing slash, * and resolves . and .. components. * @param {string} path The path to normalize * @returns {string} Normalized path
(path)
| 224 | * @returns {string} Normalized path |
| 225 | */ |
| 226 | #normalizePath(path) { |
| 227 | // Convert backslashes to forward slashes |
| 228 | let normalized = StringPrototypeReplaceAll(path, '\\', '/'); |
| 229 | // Ensure absolute path |
| 230 | if (normalized[0] !== '/') { |
| 231 | normalized = '/' + normalized; |
| 232 | } |
| 233 | // Use path.posix.normalize to resolve . and .. |
| 234 | return pathPosix.normalize(normalized); |
| 235 | } |
| 236 | |
| 237 | /** |
| 238 | * Splits a path into segments. |
no outgoing calls
no test coverage detected