(file)
| 2666 | } |
| 2667 | |
| 2668 | function inferSizeFromPath(file) { |
| 2669 | const raw = String(file || "").replace(/\\/g, "/"); |
| 2670 | const parts = raw.split("/").filter(Boolean); |
| 2671 | // Look for a folder like "16x16" / "32x32" |
| 2672 | for (const part of parts) { |
| 2673 | const m = part.match(/^(\d+)x(\d+)$/i); |
| 2674 | if (m) { |
| 2675 | const w = parseInt(m[1], 10); |
| 2676 | const h = parseInt(m[2], 10); |
| 2677 | if (Number.isFinite(w) && Number.isFinite(h) && w > 0 && h > 0) { |
| 2678 | return { w, h, tag: `${w}x${h}` }; |
| 2679 | } |
| 2680 | } |
| 2681 | } |
| 2682 | return null; |
| 2683 | } |
| 2684 | |
| 2685 | function safeSymbolFromPath(path) { |
| 2686 | const raw = String(path || "").replace(/\\/g, "/"); |
no outgoing calls
no test coverage detected