microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 101 forks source link

Avoid crash on overridden `fn.toString(…)` #163

Closed ExE-Boss closed 2 years ago

ExE-Boss commented 3 years ago

If a function has an overridden toString property, then dts‑gen ends up crashing, as the output no longer matches what dts‑gen expects.

This fixes that by always calling the original Function.prototype.toString method.


Fixes https://github.com/microsoft/dts-gen/issues/145

orta commented 2 years ago

Thanks, this looks good to me 👍🏻