Closed jelhan closed 8 years ago
I'm going to take a closer look at this one, I think we'll need to do a little more type checking instead, since other options could contain something other than string values. Specifically; handleWidth, labelWidth, and wrapperClass.
labelWidth
and handleWidth
accepts strings. It's safe to perform toString
on numbers and number objects.
wrapperClass
could be a string or an array. Array also has a toString
method but I'm not sure if bootstrap switch behaves the same for ['foo', 'bar']
and 'foo,bar'
as wrapperClass
.
If it make a difference I would simply add a check if wrapperClass
is an array and in this case doesn't touch it.
I've implemented a slightly different solution, let's move back to the issue (I'll re-open).
Not quite sure if it works for all expected cases. Should work fine if property is a string, a string object or Handlebars SafeString object. Tests would be nice.
Should fix #10.