Apply strictNullChecks to src/components/views/auth/* (#10299

* Apply `strictNullChecks` to src/components/views/auth/*

* Iterate PR
This commit is contained in:
Michael Telatynski 2023-03-07 10:45:55 +00:00 committed by GitHub
parent c79eff2292
commit 32aa18ff2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 127 additions and 122 deletions

View file

@ -19,7 +19,6 @@ import { Optional } from "matrix-events-sdk";
import { SnakedObject } from "./utils/SnakedObject";
import { IConfigOptions, ISsoRedirectOptions } from "./IConfigOptions";
import { KeysWithObjectShape } from "./@types/common";
// see element-web config.md for docs, or the IConfigOptions interface for dev docs
export const DEFAULTS: IConfigOptions = {
@ -78,10 +77,10 @@ export default class SdkConfig {
return SdkConfig.fallback.get(key, altCaseName);
}
public static getObject<K extends KeysWithObjectShape<IConfigOptions>>(
public static getObject<K extends keyof IConfigOptions>(
key: K,
altCaseName?: string,
): Optional<SnakedObject<IConfigOptions[K]>> {
): Optional<SnakedObject<NonNullable<IConfigOptions[K]>>> {
const val = SdkConfig.get(key, altCaseName);
if (val !== null && val !== undefined) {
return new SnakedObject(val);