Skip to content

Commit

Permalink
Adds ternary to check truthy check each split segment.
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-goodlab committed Mar 20, 2024
1 parent 885f8de commit 87dd892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ function tfToCdktfProp(str) {
}

var split = str.split("_");
var ret = split.map(x => x[0].toUpperCase() + x.substr(1)).join('');
var ret = split.map(x => x[0] ? x[0].toUpperCase() : '' + x.substr(1)).join('');
ret = ret[0].toLowerCase() + ret.substr(1);

return ret;
Expand Down

0 comments on commit 87dd892

Please sign in to comment.