MCPcopy Create free account
hub / github.com/adobe/react-spectrum / buildIconNames

Function buildIconNames

packages/dev/mcp/s2/scripts/build-data.mjs:54–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52}
53
54function buildIconNames() {
55 if (!fs.existsSync(ICONS_DIR)) {
56 throw new Error(`Icons directory not found: ${ICONS_DIR}`);
57 }
58 const files = fg.sync('*.svg', {cwd: ICONS_DIR, absolute: false, suppressErrors: true});
59 if (files.length === 0) {
60 throw new Error(`No icon SVG files found in: ${ICONS_DIR}`);
61 }
62 const ids = Array.from(
63 new Set(files.map(f => f.replace(/\.svg$/i, '').replace(/^S2_Icon_(.*?)(Size\d+)?_2.*/, '$1')))
64 ).sort((a, b) => a.localeCompare(b));
65 return ids;
66}
67
68function buildIllustrationNames() {
69 if (!fs.existsSync(ILLUSTRATIONS_DIR)) {

Callers 1

mainFunction · 0.85

Calls 1

sortMethod · 0.65

Tested by

no test coverage detected