(icons: string[], prefix: string)
| 31 | } |
| 32 | |
| 33 | async function customIconLoader(icons: string[], prefix: string): Promise<IconifyJSON | null> { |
| 34 | try { |
| 35 | const data = await $fetch(resources[0] + '/' + prefix + '.json', { |
| 36 | query: { |
| 37 | icons: icons.join(','), |
| 38 | }, |
| 39 | }) as IconifyJSON |
| 40 | // Simple data validation |
| 41 | if (!data || data.prefix !== prefix || !data.icons) |
| 42 | throw new Error('Invalid data' + JSON.stringify(data)) |
| 43 | return data as IconifyJSON |
| 44 | } |
| 45 | catch (e) { |
| 46 | console.error('Failed to load custom icons', e) |
| 47 | return null |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | addAPIProvider('', { resources }) |
| 52 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…