Chore: Type improvements 🧹 (#75271)

* fix some e2e flows types

* some type fixes

* must... fix... more...

* MOAR

* MOREMOREMORE

* 1 more
This commit is contained in:
Ashley Harrison
2023-09-22 15:06:49 +01:00
committed by GitHub
parent eba74f0408
commit ff0642bf6e
65 changed files with 217 additions and 387 deletions
@@ -120,14 +120,14 @@ const mapInternal = (zone: string, timestamp: number): TimeZoneInfo | undefined
case InternalTimeZones.default: {
const tz = getTimeZone();
const isInternal = tz === 'browser' || tz === 'utc';
const info = (isInternal ? mapInternal(tz, timestamp) : mapToInfo(tz, timestamp)) ?? {};
const info = isInternal ? mapInternal(tz, timestamp) : mapToInfo(tz, timestamp);
return {
countries: countriesByTimeZone[tz] ?? [],
abbreviation: '',
offsetInMins: 0,
...info,
ianaName: (info as TimeZoneInfo).ianaName,
ianaName: info?.ianaName ?? '',
name: 'Default',
zone,
};
@@ -135,7 +135,7 @@ const mapInternal = (zone: string, timestamp: number): TimeZoneInfo | undefined
case InternalTimeZones.localBrowserTime: {
const tz = moment.tz.guess(true);
const info = mapToInfo(tz, timestamp) ?? {};
const info = mapToInfo(tz, timestamp);
return {
countries: countriesByTimeZone[tz] ?? [],
@@ -143,7 +143,7 @@ const mapInternal = (zone: string, timestamp: number): TimeZoneInfo | undefined
offsetInMins: new Date().getTimezoneOffset(),
...info,
name: 'Browser Time',
ianaName: (info as TimeZoneInfo).ianaName,
ianaName: info?.ianaName ?? '',
zone,
};
}