(path)
| 28 | } |
| 29 | |
| 30 | var normalizePath = function(path) { |
| 31 | var isAbsolute = path.charAt(0) === '/', |
| 32 | trailingSlash = path.slice(-1) === '/'; |
| 33 | |
| 34 | // Normalize the path |
| 35 | path = normalizeArray(path.split('/').filter(function(p) { |
| 36 | return !!p; |
| 37 | }), !isAbsolute).join('/'); |
| 38 | |
| 39 | if (!path && !isAbsolute) { |
| 40 | path = '.'; |
| 41 | } |
| 42 | if (path && trailingSlash) { |
| 43 | path += '/'; |
| 44 | } |
| 45 | |
| 46 | return (isAbsolute ? '/' : '') + path; |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | function joinPath() { |
no test coverage detected