(filename: string)
| 15 | > | null = null; |
| 16 | |
| 17 | function readBundledJson(filename: string): any | null { |
| 18 | try { |
| 19 | // Go up from s2/src/ to dist/, then to data/ |
| 20 | const p = path.resolve(__dirname, '..', '..', 'data', filename); |
| 21 | if (!fs.existsSync(p)) { |
| 22 | return null; |
| 23 | } |
| 24 | const txt = fs.readFileSync(p, 'utf8'); |
| 25 | return JSON.parse(txt); |
| 26 | } catch { |
| 27 | return null; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | export function listIconNames(): string[] { |
| 32 | if (iconIdCache) { |
no test coverage detected