DefinitelyTyped/types/nice-try/index.d.ts
Richie Bendall 16b047f880 feat: Add typings for nice-try (#41287)
* feat: Add typings for nice-try

Signed-off-by: Richie Bendall <richiebendall@gmail.com>

* feat: Add typings for incorrect parameters

Signed-off-by: Richie Bendall <richiebendall@gmail.com>

* fix: Change void to undefined

Signed-off-by: Richie Bendall <richiebendall@gmail.com>

* chore: Update expected types

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
2020-01-23 12:03:43 -08:00

10 lines
345 B
TypeScript

// Type definitions for nice-try 2.0
// Project: https://github.com/electerious/nice-try
// Definitions by: Richie Bendall <https://github.com/Richienb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function niceTry<T>(fn: () => T): T | undefined;
declare function niceTry(val?: any): undefined;
export = niceTry;