mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
remove most uses of as any in typescript
- replaced many uses of `as any` with another more specific cast `as T` - filled in missing typed for items that needed to be typed - new runtime code was added where necessary to satisfy the new types with comments - added missing theme variable "sidebar-active" to the Theme variables - forms using `react-hook-form` are now typechecked - changed some instances of `target` into `currentTarget` while removing `as any` assertions
This commit is contained in:
@@ -23,11 +23,11 @@ type Props = WithDispatcher & {
|
||||
|
||||
var lastValues: { [key in SyncKeys]?: any } = { };
|
||||
|
||||
export function mapSync(packet: Sync.UserSettings, revision?: { [key: string]: number }) {
|
||||
export function mapSync(packet: Sync.UserSettings, revision?: Record<string, number>) {
|
||||
let update: { [key in SyncKeys]?: [ number, SyncData[key] ] } = {};
|
||||
for (let key of Object.keys(packet)) {
|
||||
let [ timestamp, obj ] = packet[key];
|
||||
if (timestamp < (revision ?? {} as any)[key] ?? 0) {
|
||||
if (timestamp < (revision ?? {})[key] ?? 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user