Closed catamphetamine closed 7 years ago
I think just defaulting to 'SvgReactComponent' and only overriding it when a 'name' parameter is given is the best way to go.
I think #71 would fix this issue. It could pass titleCaseDelim: /[\s]/
to handle witespace.
Fixed by #71
Version 0.4.4
, still the same error.
@halt-hammerzeit Are you using the new titleCaseDelim
parameter to specify your own delimiter (eg.: /\s+/g
)?
@jhamlet Oh, a parameter has to be customized.
Ok, thx for the tip.
Still my opinion is the same: it should have included whitespace in titleCaseDelim
by default.
@halt-hammerzeit Still thinking of changing to defaulting to SVGReactComponent
if there is no name
parameter given. This way I can forgo having to parse the fifteen million ways people want to name their files.
Another option is to allow for a function
as the name
parameter that receives the filename, and then individuals can customize if they really want to.
Is converted into
You should replace all whitespace
string.replace(/\s/g, '')
. And what if the filename starts, say, with a digit. Or contains a dot. You should just leave it as SVG.