Currently in the process of refactoring a NodeJS application to TypeScript. I have been consistently using object destructuring and have also been creating aliases while object destructuring, as shown in the code block below. My question is, how can I specify the type in this situation?
const {length: isRegistered} = await User.countDocuments({email: emailTo});