Skip to content

Commit b0977dd

Browse files
committed
replace case options with object
1 parent 0c91191 commit b0977dd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/components/drawing/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ drawing.font = function(s, font) {
5151
if(striding) s.style('text-decoration-line', striding2decorationLine(striding));
5252
};
5353

54+
var capitalize2transformOptions = {
55+
normal: 'none',
56+
word: 'capitalize',
57+
lower: 'lowercase',
58+
upper: 'uppercase'
59+
};
60+
5461
function capitalize2transform(capitalize) {
55-
return (
56-
capitalize === 'normal' ?
57-
'none' :
58-
capitalize === 'word' ?
59-
'capitalize' :
60-
(capitalize + 'case')
61-
);
62+
return capitalize2transformOptions[capitalize];
6263
}
6364
drawing.capitalize2transform = capitalize2transform;
6465

0 commit comments

Comments
 (0)