Skip to content

Commit 6ee639a

Browse files
jamonserranoViktor Honti
and
Viktor Honti
authoredSep 28, 2022
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

+5
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

+1-1
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'

1 commit comments

Comments
 (1)

vercel[bot] commented on Sep 28, 2022

@vercel[bot]

Successfully deployed to the following URLs:

svgr – ./

svgr-git-main-gregberge.vercel.app
svgr-gregberge.vercel.app
api.react-svgr.com

Please sign in to comment.