fix: use readonly modifiers for generics

This commit is contained in:
Mythie
2024-06-18 22:38:53 +10:00
parent 2516377cbf
commit 4077d02ccd
2 changed files with 2 additions and 4 deletions

View File

@ -17,7 +17,7 @@ export const ZSimpleTriggerJobOptionsSchema = z.object({
});
// Map the array to create a union of objects we may accept
export type TriggerJobOptions<Definitions extends Array<JobDefinition> = []> = {
export type TriggerJobOptions<Definitions extends ReadonlyArray<JobDefinition> = []> = {
[K in keyof Definitions]: {
id?: string;
name: Definitions[K]['trigger']['name'];