Use `any` keys, fixes most errors!

environments/review-zod-accoun-l4nqtf/deployments/3519
Alex Gleason 2023-06-19 10:58:07 -05:00
rodzic a54b6ee8a3
commit 0cebcc05a5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -74,8 +74,8 @@ import type { EntityStore } from 'soapbox/entity-store/types';
import type { Account } from 'soapbox/schemas'; import type { Account } from 'soapbox/schemas';
interface LegacyImmutable<T> { interface LegacyImmutable<T> {
get(key: string): (T & LegacyImmutable<T>) | undefined get(key: any): (T & LegacyImmutable<T>) | undefined
getIn(keyPath: string[]): unknown getIn(keyPath: any[]): unknown
find(predicate: (value: T & LegacyImmutable<T>, key: string) => boolean): T & LegacyImmutable<T> | undefined find(predicate: (value: T & LegacyImmutable<T>, key: string) => boolean): T & LegacyImmutable<T> | undefined
toJS(): any toJS(): any
} }
@ -84,12 +84,12 @@ function immutableize<T, S extends Record<string, T | undefined>>(state: S): S &
return { return {
...state, ...state,
get(id: string): T & LegacyImmutable<T> | undefined { get(id: any): T & LegacyImmutable<T> | undefined {
const entity = state[id]; const entity = state[id];
return entity ? immutableize(entity) : undefined; return entity ? immutableize(entity) : undefined;
}, },
getIn(keyPath: string[]): unknown { getIn(keyPath: any[]): unknown {
return lodashGet(state, keyPath); return lodashGet(state, keyPath);
}, },