Skip to content

Commit 5decc94

Browse files
authoredOct 30, 2021
fix: formatExportName for single names (#548)
1 parent 70ae0a0 commit 5decc94

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed
 

‎packages/cli/src/util.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,5 @@ export function formatExportName(name) {
6262
return `Svg${name}`
6363
}
6464

65-
if (/[-]/g.test(name)) {
66-
return camelcase(name, { pascalCase: true })
67-
}
68-
69-
return name
65+
return camelcase(name, { pascalCase: true })
7066
}

‎packages/cli/src/util.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('util', () => {
3434

3535
describe('#formatExportName', () => {
3636
it('should ensure a valid export name', () => {
37+
expect(formatExportName('foo')).toBe('Foo')
3738
expect(formatExportName('foo-bar')).toBe('FooBar')
3839
expect(formatExportName('2foo')).toBe('Svg2foo')
3940
expect(formatExportName('2foo-bar')).toBe('Svg2FooBar')

1 commit comments

Comments
 (1)

vercel[bot] commented on Oct 30, 2021

@vercel[bot]
Please sign in to comment.