I am trying to execute a small project with a MEAN and Typescript stack, and it looks like I ran into a Typescript-related issue not going to dash for emit()and Array.sum()methods.
Here is my code below ...
let options: mongoose.ModelMapReduceOption<IInvoice, any, any> = {
map: () => {
emit(this.customer, this.total);
},
reduce: (key, values) => {
return Array.sum(values);
},
out: { replace: "map_reduce_customers" },
verbose: true
};
I use the typing package on NPM and installed the typical mongodb as well as mongoose packages in my project. There are red squigglies under these two methods, but the application works fine when I run.
And yes, it correctly translates into valid JavaScript. I would just like to know if there is an input definition that I skip for Typescript to select these two methods?