Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Promise.map should generate an error if 'options' is provided but not an object #1097
Promise.map() takes as a third parameter an
Bluebird silently ignores the bad parameter and keeps an infinite concurrency witch causes unknown stress to the server if iterating over a huge dataset. It should throw an exception if the parameter is truthy but not an object to avoid such mistakes.
It's always tricky to find and prevent invalid calls to an API at runtime, there are so many ways to mess things up. However, I think the DefinitelyTyped definitions for Bluebird would have caught this error at compile time if you were using TypeScript. It would even warn you if the object had invalid options.