mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Strict null scripting (#12126)
* strict null scripting * fix compile * fix tests * fix icon
This commit is contained in:
@@ -13,7 +13,13 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit
|
||||
import { isString } from 'vs/base/common/types';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
import * as Constants from 'sql/platform/connection/common/constants';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export interface IconPath {
|
||||
light: URI;
|
||||
dark: URI;
|
||||
}
|
||||
|
||||
|
||||
// Concrete implementation of the IConnectionProfile interface
|
||||
|
||||
@@ -29,6 +35,8 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
public groupId?: string;
|
||||
public saveProfile: boolean;
|
||||
|
||||
public iconPath?: IconPath;
|
||||
|
||||
public isDisconnecting: boolean = false;
|
||||
|
||||
public constructor(
|
||||
@@ -49,7 +57,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
let capabilities = this.capabilitiesService.getCapabilities(model.providerName);
|
||||
if (capabilities && capabilities.connection && capabilities.connection.connectionOptions) {
|
||||
const options = capabilities.connection.connectionOptions;
|
||||
let appNameOption = find(options, option => option.specialValueType === interfaces.ConnectionOptionSpecialType.appName);
|
||||
let appNameOption = options.find(option => option.specialValueType === interfaces.ConnectionOptionSpecialType.appName);
|
||||
if (appNameOption) {
|
||||
let appNameKey = appNameOption.name;
|
||||
this.options[appNameKey] = Constants.applicationName;
|
||||
@@ -87,9 +95,13 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
|
||||
}
|
||||
|
||||
private static nullCheckEqualsIgnoreCase(a: string, b: string) {
|
||||
let bothNull: boolean = !a && !b;
|
||||
return bothNull ? bothNull : equalsIgnoreCase(a, b);
|
||||
private static nullCheckEqualsIgnoreCase(a?: string, b?: string) {
|
||||
if (a && !b || b && !a) {
|
||||
return false;
|
||||
} else {
|
||||
let bothNull: boolean = !a && !b;
|
||||
return bothNull ? bothNull : equalsIgnoreCase(a!, b!);
|
||||
}
|
||||
}
|
||||
|
||||
public generateNewId() {
|
||||
|
||||
Reference in New Issue
Block a user