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

Method getRuntimeCollections

src/context.ts:28–45  ·  view source on GitHub ↗
(runtimeOptions: NuxtIconRuntimeOptions)

Source from the content-addressed store, hash-verified

26 public scanner: IconUsageScanner | undefined
27
28 getRuntimeCollections(runtimeOptions: NuxtIconRuntimeOptions): string[] {
29 const resolved = runtimeOptions.fallbackToApi
30 ? collectionNames
31 : typeof this.options.serverBundle === 'string'
32 ? collectionNames
33 : this.options.serverBundle
34 ? this.options.serverBundle.collections
35 ?.map(c => typeof c === 'string' ? c : c.prefix) || []
36 : []
37
38 // Include custom collections prefixes
39 for (const collection of this.options.customCollections || []) {
40 if (collection.prefix && !resolved.includes(collection.prefix))
41 resolved.push(collection.prefix)
42 }
43
44 return resolved
45 }
46
47 private _customCollections: IconifyJSON[] | Promise<IconifyJSON[]> | undefined
48 private _serverBundle: ResolvedServerBundleOptions | Promise<ResolvedServerBundleOptions> | undefined

Callers 1

setupFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected