MCPcopy Create free account
hub / github.com/nuxt/icon / customIconLoader

Function customIconLoader

src/runtime/plugin.ts:33–49  ·  view source on GitHub ↗
(icons: string[], prefix: string)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…