1) I added a db property to the utils file as an alternative to Module.db, and changed all instances of Module.db (and other variations) to u.db. Since Module.db is implicitly an any type, it doesn't show the different controllers and their functions. However since u.db is hard coded to require the specific controller file, the types are passed through.
2) I worked on the JSDoc a bit in utils.js and the controller files. The controller files now have condensed and slightly easier to read types/parameters. Their returns have been set to return an object version of the document instead of the model in applicable cases.
3) Some controller functions weren't async, despite being marked as such in the JSDoc and being called as such, so I changed them to be async and awaited all exec()s, document creations, and the like.
1) I added a db property to the utils file as an alternative to
Module.db
, and changed all instances ofModule.db
(and other variations) tou.db
. SinceModule.db
is implicitly an any type, it doesn't show the different controllers and their functions. However sinceu.db
is hard coded to require the specific controller file, the types are passed through.2) I worked on the JSDoc a bit in
utils.js
and the controller files. The controller files now have condensed and slightly easier to read types/parameters. Their returns have been set to return an object version of the document instead of the model in applicable cases.3) Some controller functions weren't async, despite being marked as such in the JSDoc and being called as such, so I changed them to be async and awaited all
exec()
s, document creations, and the like.Let me know if there's something I should change