提交 b9693027 编写于 作者: M Matt Bierner

Use switch case

上级 7f044c79
......@@ -66,12 +66,10 @@ enum ApiThemeClassName {
namespace ApiThemeClassName {
export function fromTheme(theme: ITheme): ApiThemeClassName {
if (theme.type === LIGHT) {
return ApiThemeClassName.light;
} else if (theme.type === DARK) {
return ApiThemeClassName.dark;
} else {
return ApiThemeClassName.highContrast;
switch (theme.type) {
case LIGHT: return ApiThemeClassName.light;
case DARK: return ApiThemeClassName.dark;
default: return ApiThemeClassName.highContrast;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册