Skip to content

Commit 3c8f689

Browse files
committed
change: remove type assertion.
1 parent 0fe32bd commit 3c8f689

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tree/mr-tree.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33

44
import { CodingServer } from '../codingServer';
55
import { RepoInfo } from '../typings/commonTypes';
6-
import { IMRDetail, IMRDiffStat, MRData, IMRPathItem } from '../typings/respResult';
6+
import { IMRDiffStat, MRData, IMRPathItem } from '../typings/respResult';
77

88
enum MRType {
99
Open = `open`,
@@ -61,7 +61,7 @@ export class MRTreeDataProvider implements vscode.TreeDataProvider<ListItem<ITre
6161
return this._service.getMRList(``, element.value as MRType)
6262
.then(resp => {
6363
if (resp.code) {
64-
const msg = Object.values(resp.msg || {} as object)[0];
64+
const msg = Object.values(resp.msg || {})[0];
6565
vscode.window.showErrorMessage(`[MR] list: ${msg}`);
6666
return [];
6767
}
@@ -102,10 +102,10 @@ export class MRTreeDataProvider implements vscode.TreeDataProvider<ListItem<ITre
102102
} else if (element.contextValue === ItemType.MRItem) {
103103
return this._service.getMRDiff(element.value as number)
104104
.then(({ data: { diffStat } }) => {
105-
return (element as MRItem).getChildren(diffStat);
105+
return element.getChildren(diffStat);
106106
});
107107
} else if (element.contextValue === ItemType.Node) {
108-
return (element as FileNode).getChildren();
108+
return element.getChildren();
109109
}
110110

111111
return Promise.resolve([]);

0 commit comments

Comments
 (0)