flow-typed icon indicating copy to clipboard operation
flow-typed copied to clipboard

Mongoose populate

Open maxaggedon opened this issue 5 years ago • 3 comments

set the correct return type for Mongoose$Document.popluate() (https://github.com/Automattic/mongoose/blob/4545d44c56a1fe62fa21d783b70bb3a8ff1734cd/lib/document.js#L2483)

maxaggedon avatar Oct 31 '18 18:10 maxaggedon

Hi @maxaggedon! Looks like the libdef is failing on 0.85.0. The reason is that 0.85.0 is much stricter with type annotations, see: https://medium.com/flow-type/asking-for-required-annotations-64d4f9c1edf8

Would you be willing to fix those issues too?

villesau avatar Oct 31 '18 19:10 villesau

Hi @villesau ! I did the same fixes for v5 ;)

maxaggedon avatar Nov 01 '18 08:11 maxaggedon

Callback-version of Document#populate is not purposed to return anything at all. So, imo, it would be better and cleaner to add a separate definition to callback-less version, like this one:

populate(path: string): this;

mi6gan avatar Nov 07 '18 21:11 mi6gan