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

Function installCollection

test/bundle.test.ts:9–29  ·  view source on GitHub ↗
(dir: string, prefix: string, icon: string)

Source from the content-addressed store, hash-verified

7
8// Install a fake `@iconify-json/<prefix>` collection into `<dir>/node_modules`
9function installCollection(dir: string, prefix: string, icon: string) {
10 const collectionDir = join(dir, 'node_modules', '@iconify-json', prefix)
11 mkdirSync(collectionDir, { recursive: true })
12 writeFileSync(join(collectionDir, 'package.json'), JSON.stringify({
13 name: `@iconify-json/${prefix}`,
14 version: '0.0.0',
15 main: 'index.js',
16 exports: {
17 './*': './*',
18 './icons.json': './icons.json',
19 },
20 }))
21 writeFileSync(join(collectionDir, 'icons.json'), JSON.stringify({
22 prefix,
23 icons: {
24 [icon]: { body: '<path d="M0 0h24v24H0z"/>' },
25 },
26 width: 24,
27 height: 24,
28 }))
29}
30
31let root: string
32

Callers 1

bundle.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…