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

Use switch case

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