mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
25 lines
555 B
JavaScript
25 lines
555 B
JavaScript
/* @flow */
|
|
'use strict';
|
|
|
|
export const TEXT_TRANSFORM = {
|
|
NONE: 0,
|
|
LOWERCASE: 1,
|
|
UPPERCASE: 2,
|
|
CAPITALIZE: 3
|
|
};
|
|
|
|
export type TextTransform = $Values<typeof TEXT_TRANSFORM>;
|
|
|
|
export const parseTextTransform = (textTransform: string): TextTransform => {
|
|
switch (textTransform) {
|
|
case 'uppercase':
|
|
return TEXT_TRANSFORM.UPPERCASE;
|
|
case 'lowercase':
|
|
return TEXT_TRANSFORM.LOWERCASE;
|
|
case 'capitalize':
|
|
return TEXT_TRANSFORM.CAPITALIZE;
|
|
}
|
|
|
|
return TEXT_TRANSFORM.NONE;
|
|
};
|