diff --git a/packages/cli/src/util.js b/packages/cli/src/util.js index e61b6510..4a35516f 100644 --- a/packages/cli/src/util.js +++ b/packages/cli/src/util.js @@ -62,9 +62,5 @@ export function formatExportName(name) { return `Svg${name}` } - if (/[-]/g.test(name)) { - return camelcase(name, { pascalCase: true }) - } - - return name + return camelcase(name, { pascalCase: true }) } diff --git a/packages/cli/src/util.test.js b/packages/cli/src/util.test.js index 70f62cc0..9dac4ce6 100644 --- a/packages/cli/src/util.test.js +++ b/packages/cli/src/util.test.js @@ -34,6 +34,7 @@ describe('util', () => { describe('#formatExportName', () => { it('should ensure a valid export name', () => { + expect(formatExportName('foo')).toBe('Foo') expect(formatExportName('foo-bar')).toBe('FooBar') expect(formatExportName('2foo')).toBe('Svg2foo') expect(formatExportName('2foo-bar')).toBe('Svg2FooBar')