microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
122 stars 38 forks source link

Removing conditional operators #68

Closed lohitakshgupta closed 1 year ago

lohitakshgupta commented 1 year ago

Instead of doing a typescript update and fixing other build errors with the update, removing the conditional operators instead. They have been defined like this at the start:

let teamContext: ITeamContext | undefined; let webContext: IWebContext | undefined;; let hostPageContext: IPageContext | undefined;

And there's a null check, example:

export function getPageContext(): IPageContext {
    if (!hostPageContext) {
        throw new Error(getWaitForReadyError("getPageContext"));
    }
    return hostPageContext;
}