(path)
| 107 | * @return {string} the parent folder, or "" |
| 108 | */ |
| 109 | var parentFolder = function (path) { |
| 110 | if (path.slice(-1) === "/") { |
| 111 | path = path.substring(0, path.length - 1); |
| 112 | } |
| 113 | var lastSlash = path.lastIndexOf("/"); |
| 114 | return (lastSlash > 0) ? path.substring(0, lastSlash) : ""; |
| 115 | }; |
| 116 | |
| 117 | /** |
| 118 | * Returns the path with a slash at the end. |