MCPcopy Index your code
hub / github.com/deployd/deployd / normalizePath

Function normalizePath

lib/internal-client.js:30–47  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

28}
29
30var 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
50function joinPath() {

Callers 1

joinPathFunction · 0.85

Calls 1

normalizeArrayFunction · 0.85

Tested by

no test coverage detected