This PR converts all of our Mongoose schema files to TS.
How I did it
The conversion was pretty straight forward:
Rename all files from .js to .ts
Add a typing for the untyped mongo-cursor-pagination module
While I was at it, I ran prettier on all of the files as well.
UPDATE
I've updated this PR with 0022ca2 to export a schema type from every file. This will provide us a type to conveniently describe the output of DB queries, such as:
import Batch, { BatchSchema } from '../schema/batch.js'
function query(): Promise<BatchSchema> {
return Batch.findOne()
}
What I'm changing
This PR converts all of our Mongoose schema files to TS.
How I did it
The conversion was pretty straight forward:
mongo-cursor-pagination
moduleprettier
on all of the files as well.UPDATE
I've updated this PR with 0022ca2 to export a schema type from every file. This will provide us a type to conveniently describe the output of DB queries, such as:
Relates to #187