Skip to content

Commit 6ee639a

Browse files
jamonserranoViktor Honti
andauthored
feat: support spaces in file names (#779)
Co-authored-by: Viktor Honti <viktor.honti@airtame.com>
1 parent 1dbc3e2 commit 6ee639a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/core/src/state.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ describe('state', () => {
2424
filePath: 'a&b~c-d_e.svg',
2525
componentName: 'SvgAbcDE',
2626
})
27+
expect(expandState({ filePath: 'Arrow up.svg' })).toEqual({
28+
filePath: 'Arrow up.svg',
29+
componentName: 'SvgArrowUp',
30+
})
31+
2732
})
2833
})
2934
})

packages/core/src/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface State {
1313
}
1414
}
1515

16-
const VALID_CHAR_REGEX = /[^a-zA-Z0-9_-]/g
16+
const VALID_CHAR_REGEX = /[^a-zA-Z0-9 _-]/g
1717

1818
const getComponentName = (filePath?: string): string => {
1919
if (!filePath) return 'SvgComponent'

0 commit comments

Comments
 (0)