MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / safeSymbolFromPath

Function safeSymbolFromPath

app.js:2685–2691  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

2683}
2684
2685function safeSymbolFromPath(path) {
2686 const raw = String(path || "").replace(/\\/g, "/");
2687 const base = raw.split("/").pop() || raw;
2688 const noExt = base.replace(/\.[a-z0-9]+$/i, "");
2689 const sym = noExt.replace(/[^a-zA-Z0-9_]/g, "_");
2690 return sym || "icon";
2691}
2692
2693function imageDataToRgb565(data, w, h, bgHex) {
2694 const rgb565 = new Array(w * h);

Callers 6

app.jsFile · 0.85
addIconElementFunction · 0.85
addAssetElementToCanvasFunction · 0.85
getLayerLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected