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

Function extname

src/utils/Path.js:45–52  ·  view source on GitHub ↗

* returns the extension of the path, from the last occurrence of the . (period) * character to end of string in the last portion of the path. * If there is no . in the last portion of the path, or if there are no . characters * other than the first character of the basename of path (see path.b

(path)

Source from the content-addressed store, hash-verified

43 * @param {string} path
44 */
45 extname(path) {
46 const filename = path.split("/").slice(-1)[0];
47 if (/.+\..*$/.test(filename)) {
48 return /(?:\.([^.]*))?$/.exec(filename)[0] || "";
49 }
50
51 return "";
52 },
53
54 /**
55 * returns a path string from an object.

Callers

nothing calls this directly

Calls 1

execMethod · 0.65

Tested by

no test coverage detected