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:
parent
43e4e8fb61
commit
696514862d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue