MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / format

Function format

src/utils/Path.js:58–71  ·  view source on GitHub ↗

* returns a path string from an object. * @param {PathObject} pathObject

(pathObject)

Source from the content-addressed store, hash-verified

56 * @param {PathObject} pathObject
57 */
58 format(pathObject) {
59 let { root, dir, ext, name, base } = pathObject;
60
61 if (base || !ext.startsWith(".")) {
62 ext = "";
63 if (base) name = "";
64 }
65
66 dir = dir || root;
67
68 if (!dir.endsWith("/")) dir += "/";
69
70 return dir + (base || name) + ext;
71 },
72
73 /**
74 * The path.isAbsolute() method determines if path is an absolute path.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected