Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fix: Support nodejs v8 promise typing #3507
So, typescript interfaces are mutable. And it is possible for other packages (like
ChainableInterface (what knex.select etc. returns) is not a Promise, but it exposes some promise methods which get delegated to the resolved promise when invoked.
When this happens then
This is usually not a problem in practice, but one case in particular (timeout) is problematic because Bluebird's timeout doesn't match the signature of an identically named function implemented in Knex.
There shouldn't really be a conflict because Bluebird's timeout is not actually available through QueryInterface even if it was the global Promise. But the conflict arises because of the lax type definition of QueryInterface.
It is conceptually similar to Lodash.pick. You get only the keys that you pick mapped to the corresponding values: