Skip to content

Commit f2655ec

Browse files
committed
Use satisfies for typing
1 parent 1c3043e commit f2655ec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/common/datetime/weekday.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const WEEKDAYS_SHORT = [
2626
"thu",
2727
"fri",
2828
"sat",
29-
] as const;
29+
] as const satisfies readonly WeekdayShort[];
3030

3131
export const WEEKDAYS_LONG = [
3232
"sunday",
@@ -36,24 +36,24 @@ export const WEEKDAYS_LONG = [
3636
"thursday",
3737
"friday",
3838
"saturday",
39-
] as const;
39+
] as const satisfies readonly WeekdayLong[];
4040

41-
export const WEEKDAY_MAP: Record<WeekdayIndex, WeekdayShort> = {
41+
export const WEEKDAY_MAP = {
4242
0: "sun",
4343
1: "mon",
4444
2: "tue",
4545
3: "wed",
4646
4: "thu",
4747
5: "fri",
4848
6: "sat",
49-
} as const;
49+
} as const satisfies Record<WeekdayIndex, WeekdayShort>;
5050

51-
export const WEEKDAY_SHORT_TO_LONG: Record<WeekdayShort, WeekdayLong> = {
51+
export const WEEKDAY_SHORT_TO_LONG = {
5252
sun: "sunday",
5353
mon: "monday",
5454
tue: "tuesday",
5555
wed: "wednesday",
5656
thu: "thursday",
5757
fri: "friday",
5858
sat: "saturday",
59-
} as const;
59+
} as const satisfies Record<WeekdayShort, WeekdayLong>;

0 commit comments

Comments
 (0)