Skip to content

Commit

Permalink
Merge pull request #419 from Kitware/PropertyFactory
Browse files Browse the repository at this point in the history
fix(PropertyFactory): Fix capitalize function
  • Loading branch information
jourdain authored Jan 23, 2018
2 parents 0ebaa0b + 449087e commit c1c57c4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/React/Properties/PropertyFactory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ const factoryMapping = {
/* eslint-enable max-len */


function capitalize(str) {
function capitalizeOld(str) {
return str[0].toUpperCase() + str.substr(1).toLowerCase();
}


function capitalize(str) {
return str[0].toUpperCase() + str.substr(1);
}

export default function render(prop, vd, onChange) {
var fn = factoryMapping[capitalize(prop.ui.propType)];
var fn = factoryMapping[capitalize(prop.ui.propType)] || factoryMapping[capitalizeOld(prop.ui.propType)];
if (fn) {
return fn(prop, vd, onChange);
}
Expand Down

0 comments on commit c1c57c4

Please sign in to comment.