Apply strictNullChecks to src/utils/*!exportUtils (#10455

* Apply `strictNullChecks` to `src/utils/exportUtils`

* strict fix

* fix strictNullChecks issues in some utils

* fix error message

* test coverage

* lint

* more strictNullChecks

* small optimisation for getUniqueRoomsWithIndividuals

* tidy

* test coverage
This commit is contained in:
Kerry 2023-04-03 20:26:55 +12:00 committed by GitHub
parent 4ed6e39067
commit 81a4498a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 143 additions and 81 deletions

View file

@ -47,7 +47,6 @@ import { MapperOpts } from "matrix-js-sdk/src/event-mapper";
import type { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall";
import { MatrixClientPeg as peg } from "../../src/MatrixClientPeg";
import { makeType } from "../../src/utils/TypeUtils";
import { ValidatedServerConfig } from "../../src/utils/ValidatedServerConfig";
import { EnhancedMap } from "../../src/utils/maps";
import { AsyncStoreWithClient } from "../../src/stores/AsyncStoreWithClient";
@ -591,13 +590,13 @@ export function mkStubRoom(
} as unknown as Room;
}
export function mkServerConfig(hsUrl: string, isUrl: string) {
return makeType(ValidatedServerConfig, {
export function mkServerConfig(hsUrl: string, isUrl: string): ValidatedServerConfig {
return {
hsUrl,
hsName: "TEST_ENVIRONMENT",
hsNameIsDifferent: false, // yes, we lie
isUrl,
});
} as ValidatedServerConfig;
}
// These methods make some use of some private methods on the AsyncStoreWithClient to simplify getting into a consistent