Apply strictNullChecks
to src/components/views/auth/*
(#10299
* Apply `strictNullChecks` to src/components/views/auth/* * Iterate PR
This commit is contained in:
parent
c79eff2292
commit
32aa18ff2e
16 changed files with 127 additions and 122 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue