Skip to content

Commit cc1d784

Browse files
committed
refactor: use TupleToUnion from type-fest for WeekDay type
- Replace typeof WEEK_DAYS[number] with TupleToUnion<typeof WEEK_DAYS> - Leverage type-fest utility for more explicit type transformation
1 parent 5a4458a commit cc1d784

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/data-loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @module data-loader
99
*/
1010

11-
import type { IntRange } from 'type-fest';
11+
import type { IntRange, TupleToUnion } from 'type-fest';
1212
import type { WEEK_DAYS } from './_consts.ts';
1313
import type { LoadedUsageEntry, SessionBlock } from './_session-blocks.ts';
1414
import type {
@@ -740,7 +740,7 @@ export type DateFilter = {
740740
until?: string; // YYYYMMDD format
741741
};
742742

743-
type WeekDay = typeof WEEK_DAYS[number];
743+
type WeekDay = TupleToUnion<typeof WEEK_DAYS>;
744744
type DayOfWeek = IntRange<0, typeof WEEK_DAYS['length']>; // 0 = Sunday, 1 = Monday, ..., 6 = Saturday
745745

746746
/**

0 commit comments

Comments
 (0)