strict null checks: several ipc utils

This commit is contained in:
Joao Moreno
2018-11-05 13:48:14 +01:00
parent f695de3a3f
commit 43de37cab4
12 changed files with 54 additions and 31 deletions
@@ -19,14 +19,14 @@ export class WorkspacesChannel implements IWorkspacesChannel {
constructor(private service: IWorkspacesMainService) { }
listen<T>(event: string, arg?: any): Event<T> {
throw new Error('No events');
throw new Error(`Event not found: ${event}`);
}
call(command: string, arg?: any): Thenable<any> {
switch (command) {
case 'createWorkspace': {
const rawFolders: IWorkspaceFolderCreationData[] = arg;
let folders: IWorkspaceFolderCreationData[];
let folders: IWorkspaceFolderCreationData[] | undefined = undefined;
if (Array.isArray(rawFolders)) {
folders = rawFolders.map(rawFolder => {
return {
@@ -40,7 +40,7 @@ export class WorkspacesChannel implements IWorkspacesChannel {
}
}
return void 0;
throw new Error(`Call not found: ${command}`);
}
}