From 5fd29d5ad84a3863349c328896349bcb873966b9 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Mon, 27 Jan 2020 16:47:42 -0800 Subject: [PATCH] Missing changes (#8972) * add more folders to strictire compile, add more strict compile options * update ci * remove unnecessary assertion * add missing checks --- .../common/connectionProfileGroup.ts | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/sql/platform/connection/common/connectionProfileGroup.ts b/src/sql/platform/connection/common/connectionProfileGroup.ts index d010a64383..f1e2904024 100644 --- a/src/sql/platform/connection/common/connectionProfileGroup.ts +++ b/src/sql/platform/connection/common/connectionProfileGroup.ts @@ -76,7 +76,7 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro } public hasChildren(): boolean { - if ((this.children && this.children.length > 0) || (this.connections && this.connections.length > 0)) { + if (this.children.length > 0 || this.connections.length > 0) { return true; } return false; @@ -86,38 +86,30 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro * Returns true if all connections in the tree have valid options using the correct capabilities */ public get hasValidConnections(): boolean { - if (this.connections) { - let invalidConnections = find(this.connections, c => !c.isConnectionOptionsValid); - if (invalidConnections !== undefined) { - return false; - } else { - let childrenAreValid: boolean = true; - this.children.forEach(element => { - let isChildValid = element.hasValidConnections; - if (!isChildValid) { - childrenAreValid = false; - } - }); - return childrenAreValid; - } + let invalidConnections = find(this.connections, c => !c.isConnectionOptionsValid); + if (invalidConnections !== undefined) { + return false; } else { - return true; + let childrenAreValid: boolean = true; + this.children.forEach(element => { + let isChildValid = element.hasValidConnections; + if (!isChildValid) { + childrenAreValid = false; + } + }); + return childrenAreValid; } } public getChildren(): (ConnectionProfile | ConnectionProfileGroup)[] { let allChildren: (ConnectionProfile | ConnectionProfileGroup)[] = []; - if (this.connections) { - this.connections.forEach((conn) => { - allChildren.push(conn); - }); - } + this.connections.forEach((conn) => { + allChildren.push(conn); + }); - if (this.children) { - this.children.forEach((group) => { - allChildren.push(group); - }); - } + this.children.forEach((group) => { + allChildren.push(group); + }); return allChildren; }