(data: string)
| 16 | } |
| 17 | |
| 18 | function parse(data: string): Toolkit[] { |
| 19 | const toolkits = JSON.parse(data) as Toolkit[]; |
| 20 | |
| 21 | if (!Array.isArray(toolkits)) { |
| 22 | throw new Error('toolkits.json must contain an array'); |
| 23 | } |
| 24 | |
| 25 | if (toolkits.length === 0) { |
| 26 | console.warn('[Toolkits] Warning: toolkits.json is empty'); |
| 27 | } |
| 28 | |
| 29 | return toolkits; |
| 30 | } |
| 31 | |
| 32 | export async function getAllToolkits(): Promise<Toolkit[]> { |
| 33 | if (cached) return cached.list; |
no test coverage detected
searching dependent graphs…