nitrojs / nitro

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

chore(types): annotate `h3Exports` types #2818

Closed iiio2 closed 1 day ago

iiio2 commented 3 days ago

๐Ÿ”— Linked issue

โ“ Type of change

๐Ÿ“š Description

resolveModuleExportNames function returns Promise<string[]>. Here we have called it but h3Exports is returning any. I have explicitly annotated string[] for h3Exports. Also below we are filtering h3Exports. I think filter can be used only with arrays. That is why I think we may explicitly annotate h3Exports here.

๐Ÿ“ Checklist

pi0 commented 1 day ago

Thanks for PR, but in this case, simply relying on inference should be good enough internally.

iiio2 commented 1 day ago

Ok @pi0 . Thank you so much.