Netflix / nerror

nerror: rich JavaScript errors
MIT License
122 stars 14 forks source link

feat: Add TypeScript definition #4

Closed agirton closed 5 years ago

agirton commented 5 years ago

This adds the TypeScript definition file. Since users can't use @types/verror for this package and if the API diverges at all, figured it would be good to have a TypeScript definition file. The definition file is largely copied from @types/verror with the addition of the PError.

This PR also adds tests to ensure those assertions are correct. I followed a similar pattern that is used in other open source JS libraries.

hekike commented 5 years ago

Awesome, thanks!