Skip to content

Commit

Permalink
Gracefully handle global promise pollution (#3502)
Browse files Browse the repository at this point in the history
Update QueryInterface to proxy to only standard promise methods
Update QueryInterface type to be explicit about the methods being
proxied
This primarily handles pollution of global Promise (either the type or
the global object at runtime) by other libraries.

Fixes: #3422
  • Loading branch information
lorefnon authored and kibertoad committed Oct 29, 2019
1 parent 0560959 commit 6f5a13d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -1401,7 +1401,7 @@ declare namespace Knex {
// Chainable interface
//

interface ChainableInterface<T = any> extends Promise<T> {
interface ChainableInterface<T = any> extends Pick<Promise<T>, "then" | "catch" | "finally"> {
toQuery(): string;
options(options: { [key: string]: any }): this;
connection(connection: any): this;
Expand Down

0 comments on commit 6f5a13d

Please sign in to comment.