1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Make SonarCloud happier (#2850)

* Make SonarCloud happier

* Revert one change due to lack of strict mode upstream

* Fix typo
This commit is contained in:
Michael Telatynski
2022-11-07 12:16:48 +00:00
committed by GitHub
parent 52932f59ab
commit 6c543382e6
23 changed files with 102 additions and 152 deletions

View File

@@ -190,9 +190,9 @@ export function isFunction(value: any) {
*/
// note using 'keys' here would shadow the 'keys' function defined above
export function checkObjectHasKeys(obj: object, keys: string[]) {
for (let i = 0; i < keys.length; i++) {
if (!obj.hasOwnProperty(keys[i])) {
throw new Error("Missing required key: " + keys[i]);
for (const key of keys) {
if (!obj.hasOwnProperty(key)) {
throw new Error("Missing required key: " + key);
}
}
}