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

Function parse

src/utils/Path.js:119–133  ·  view source on GitHub ↗

* * @param {string} path * @returns {PathObject}

(path)

Source from the content-addressed store, hash-verified

117 * @returns {PathObject}
118 */
119 parse(path) {
120 const root = path.startsWith("/") ? "/" : "";
121 const dir = this.dirname(path);
122 const ext = this.extname(path);
123 const name = this.basename(path, ext);
124 const base = this.basename(path);
125
126 return {
127 root,
128 dir,
129 base,
130 ext,
131 name,
132 };
133 },
134
135 /**
136 * Resolve the path eg.

Callers

nothing calls this directly

Calls 1

basenameMethod · 0.80

Tested by

no test coverage detected