debt - less type cases

This commit is contained in:
Benjamin Pasero
2019-05-15 11:42:43 -07:00
parent c759b3e0dc
commit 376061acc4
28 changed files with 68 additions and 77 deletions

View File

@@ -666,7 +666,7 @@ class CachedFolderConfiguration extends Disposable implements IFolderConfigurati
private readonly configurationCache: IConfigurationCache
) {
super();
this.key = createSHA1(join(folder.path, configFolderRelativePath)).then(key => (<ConfigurationKey>{ type: 'folder', key }));
this.key = createSHA1(join(folder.path, configFolderRelativePath)).then(key => ({ type: 'folder', key }));
this.configurationModel = new ConfigurationModel();
}

View File

@@ -396,7 +396,7 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
}
private compareFolders(currentFolders: IWorkspaceFolder[], newFolders: IWorkspaceFolder[]): IWorkspaceFoldersChangeEvent {
const result = { added: [], removed: [], changed: [] } as IWorkspaceFoldersChangeEvent;
const result: IWorkspaceFoldersChangeEvent = { added: [], removed: [], changed: [] };
result.added = newFolders.filter(newFolder => !currentFolders.some(currentFolder => newFolder.uri.toString() === currentFolder.uri.toString()));
for (let currentIndex = 0; currentIndex < currentFolders.length; currentIndex++) {
let currentFolder = currentFolders[currentIndex];