Skip to content

Commit 118305f

Browse files
committed
Remove some unnecessary type assertions.
1 parent eb5404d commit 118305f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/calendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ abstract class HelperBase {
785785
return calendarDate;
786786
}
787787
validateCalendarDate(calendarDate: Partial<FullCalendarDate>): asserts calendarDate is FullCalendarDate {
788-
const { era, month, year, day, eraYear, monthCode, monthExtra } = calendarDate as Partial<FullCalendarDate>;
788+
const { era, month, year, day, eraYear, monthCode, monthExtra } = calendarDate;
789789
// When there's a suffix (e.g. "5bis" for a leap month in Chinese calendar)
790790
// the derived class must deal with it.
791791
if (monthExtra !== undefined) throw new RangeError('Unexpected `monthExtra` value');
@@ -2082,7 +2082,7 @@ abstract class ChineseBaseHelper extends HelperBase {
20822082
abstract override id: BuiltinCalendarId;
20832083
calendarType = 'lunisolar' as const;
20842084
inLeapYear(calendarDate: CalendarYearOnly, cache: OneObjectCache) {
2085-
const months = this.getMonthList(calendarDate.year, cache as OneObjectCache);
2085+
const months = this.getMonthList(calendarDate.year, cache);
20862086
return ObjectEntries(months).length === 13;
20872087
}
20882088
monthsInYear(calendarDate: CalendarYearOnly, cache: OneObjectCache) {

lib/ecmascript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export function ParseTemporalInstant(isoString: string) {
594594
if (!z && !offset) throw new RangeError('Temporal.Instant requires a time zone offset');
595595
// At least one of z or offset is defined, but TS doesn't seem to understand
596596
// that we only use offset if z is not defined (and thus offset must be defined).
597-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
597+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion
598598
const offsetNs = z ? 0 : ParseTimeZoneOffsetString(offset!);
599599
({ year, month, day, hour, minute, second, millisecond, microsecond, nanosecond } = BalanceISODateTime(
600600
year,

0 commit comments

Comments
 (0)