(path: string)
| 168 | }; |
| 169 | |
| 170 | const normalize = function normalize(path: string) { |
| 171 | assertPath(path); |
| 172 | |
| 173 | if (path.length === 0) { |
| 174 | return '.'; |
| 175 | } |
| 176 | |
| 177 | const isAbsolute = path.charCodeAt(0) === 47; /*/*/ |
| 178 | const trailingSeparator = path.charCodeAt(path.length - 1) === 47; /*/*/ |
| 179 | |
| 180 | // Normalize the path |
| 181 | path = normalizeStringPosix(path, !isAbsolute); |
| 182 | |
| 183 | if (path.length === 0 && !isAbsolute) { |
| 184 | path = '.'; |
| 185 | } |
| 186 | if (path.length > 0 && trailingSeparator) { |
| 187 | path += '/'; |
| 188 | } |
| 189 | |
| 190 | if (isAbsolute) { |
| 191 | return '/' + path; |
| 192 | } |
| 193 | return path; |
| 194 | }; |
| 195 | |
| 196 | const isAbsolute = function isAbsolute(path: string) { |
| 197 | assertPath(path); |
no test coverage detected
searching dependent graphs…