extension: Migrate to TypeScript 4.8

Per https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to,
`Object.entries()` no longer accepts nullable objects.
The suggested fix is to add a `T extends {}` constraint, but that's
disallowed by https://typescript-eslint.io/rules/ban-types/. So instead
change the parameter types from `T` to `NonNull<T>`.
This commit is contained in:
relrelb 2022-09-02 11:27:34 +03:00 committed by relrelb
parent 43e4e8fb61
commit 696514862d
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ async function queryTabStatus(
optionsChanged();
}
function objectsEqual<T>(x: T, y: T) {
function objectsEqual<T>(x: NonNullable<T>, y: NonNullable<T>) {
for (const [key, value] of Object.entries(x)) {
if (y[key as keyof T] !== value) {
return false;