Skip to content

Commit d65a834

Browse files
committed
feat: optimized code
1 parent 2b72ea5 commit d65a834

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • packages/quick-open/src/common

packages/quick-open/src/common/icon.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { URI } from '@opensumi/ide-core-common';
22

33
export function iconPath2URI(iconPath: URI | { light: URI; dark: URI }, themeType?: string): URI | undefined {
44
if (URI.isUri(iconPath)) {
5-
const tmpIconPath = iconPath as URI;
6-
7-
return Object.prototype.hasOwnProperty.call(tmpIconPath, 'codeUri') ? tmpIconPath : new URI(tmpIconPath.toString());
5+
return 'codeUri' in iconPath ? iconPath : new URI((iconPath as URI).toString());
86
}
97

108
if ((iconPath.dark || iconPath.light) && themeType) {

0 commit comments

Comments
 (0)