unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.58k stars 480 forks source link

Scheduled tasks type on nitro options are incorrect #2283

Closed noook closed 4 months ago

noook commented 4 months ago

Environment

Nitro 2.9

Reproduction

— (I'll do the PR)

Describe the bug

https://github.com/unjs/nitro/blob/8a62e7dbaeeffb6dff533c7000aba51a5c85e479/src/types/nitro.ts#L342

The types are incorrect, it should be

 scheduledTasks?:  { [cron: string]: string[] }; 

I think maybe of having to handle the undefined case when we have no scheduled tasks, we could just make this property be an empty object as default (as it's assignable).

Additional context

No response

Logs

No response

pi0 commented 4 months ago

Thanks for helping on this but please either make a proposal for enhancement and wait for discussion or an issue with reproduction next times 🙏🏼