-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor TypeScript definition to CommonJS compatible export (#2)
- Loading branch information
1 parent
c7ad279
commit 15e5d94
Showing
4 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
/** | ||
Make unhandled promise rejections fail hard right away instead of the default [silent fail](https://gist.github.com/benjamingr/0237932cee84712951a2). | ||
declare const hardRejection: { | ||
/** | ||
Make unhandled promise rejections fail hard right away instead of the default [silent fail](https://gist.github.com/benjamingr/0237932cee84712951a2). | ||
@param log - Custom logging function to print the rejected promise. Receives the error stack. Default: `console.error`. | ||
*/ | ||
export default function hardRejection(log?: (stack?: string) => void): void; | ||
@param log - Custom logging function to print the rejected promise. Receives the error stack. Default: `console.error`. | ||
*/ | ||
(log?: (stack?: string) => void): void; | ||
|
||
// TODO: Remove this for the next major release, refactor the whole definition to: | ||
// declare function hardRejection(log?: (stack?: string) => void): void; | ||
// export = hardRejection; | ||
default: typeof hardRejection; | ||
}; | ||
|
||
export = hardRejection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters