MCPcopy Create free account
hub / github.com/Stuk/jszip / parentFolder

Function parentFolder

lib/object.js:109–115  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

107 * @return {string} the parent folder, or ""
108 */
109var 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.

Callers 1

fileAddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected