1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

Conform more of the code base to strict null checking (#10147)

* Conform more of the code base to strict null checking

* More strict fixes

* More strict work

* Fix missing optional type

* Iterate
This commit is contained in:
Michael Telatynski
2023-02-13 17:01:43 +00:00
committed by GitHub
parent fa036a5080
commit da7aa4055e
380 changed files with 682 additions and 694 deletions

View File

@ -22,7 +22,7 @@ import type * as MegolmExportEncryptionExport from "../../src/utils/MegolmExport
const webCrypto = new Crypto();
function getRandomValues<T extends ArrayBufferView>(buf: T): T {
function getRandomValues<T extends ArrayBufferView | null>(buf: T): T {
// @ts-ignore fussy generics
return nodeCrypto.randomFillSync(buf);
}
@ -133,7 +133,7 @@ cissyYBxjsfsAn
// TODO find a subtlecrypto shim which doesn't break this test
it.skip("should decrypt a range of inputs", function () {
function next(i: number): unknown {
function next(i: number): Promise<string | undefined> | undefined {
if (i >= TEST_VECTORS.length) {
return;
}
@ -144,7 +144,7 @@ cissyYBxjsfsAn
return next(i + 1);
});
}
return next(0);
next(0);
});
});