MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / normalizeIconNameFromFile

Function normalizeIconNameFromFile

app.js:2639–2648  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

2637}
2638
2639function normalizeIconNameFromFile(file) {
2640 const raw = String(file || "").replace(/\\/g, "/");
2641 const baseName = raw.split("/").pop() || raw;
2642 const base = String(baseName || "")
2643 .replace(/\.[a-z0-9]+$/i, "")
2644 .replace(/[_\-]+/g, " ")
2645 .replace(/\s+/g, " ")
2646 .trim();
2647 return base || "icon";
2648}
2649
2650function buildIconUrl(file) {
2651 // Important: encode spaces and other characters safely, without breaking subpaths

Callers 3

loadFileIconsFunction · 0.85
app.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected