MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / slugToComponentName

Function slugToComponentName

src/utils/cli.js:6–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4const UPPERCASE_PARTS = new Set(['ascii']);
5
6const slugToComponentName = slug => {
7 if (!slug) return '';
8 return slug
9 .split('-')
10 .map(part => {
11 if (UPPERCASE_PARTS.has(part.toLowerCase())) return part.toUpperCase();
12 return part.charAt(0).toUpperCase() + part.slice(1);
13 })
14 .join('');
15};
16
17export const generateCliCommands = (language, style, category, subcategory, dependencies = '') => {
18 if (!category || !subcategory) return null;

Callers 1

generateCliCommandsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected