Skip to content

Commit 70c806f

Browse files
committed
chore: Constrain allowed property names while keeping the types narrow
This is important when we iterate over the possible values, for example.
1 parent 7500074 commit 70c806f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

harmonizer/properties.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { HarmonyRelease, HarmonyTrack } from './types.ts';
22

33
/** Release properties which can be combined from data of multiple providers. */
4-
export const combinableReleaseProperties: Array<keyof HarmonyRelease> = [
4+
export const combinableReleaseProperties = [
55
'externalLinks',
66
'availableIn',
77
'excludedFrom',
88
'info',
9-
];
9+
] as const satisfies Array<keyof HarmonyRelease>;
1010

1111
/**
1212
* Release properties which have to be taken from one provider and can not be combined from data of multiple providers.
@@ -27,15 +27,15 @@ export const immutableReleaseProperties = [
2727
'images', // TODO: make images combinable? combine if not only front covers?
2828
'copyright',
2929
'credits',
30-
] as const;
30+
] as const satisfies Array<keyof HarmonyRelease>;
3131

3232
/** Track properties which have to be taken from one provider and can not be combined from data of multiple providers. */
3333
export const immutableTrackProperties = [
3434
'isrc',
3535
'length',
36-
] as const;
36+
] as const satisfies Array<keyof HarmonyTrack>;
3737

3838
/** Track properties which can be combined from data of multiple providers. */
39-
export const combinableTrackProperties: Array<keyof HarmonyTrack> = [
39+
export const combinableTrackProperties = [
4040
'recording',
41-
];
41+
] as const satisfies Array<keyof HarmonyTrack>;

0 commit comments

Comments
 (0)