Closed unpollito closed 3 years ago
Just been integrating the lib today and hit the TypeError: google_play_billing_validator_1.default is not a constructor
. Default import syntax should be definitely supported out of the box. @Deishelon got chance to take a look at it?
LGTM! Thanks 💕
Description
Currently, importing the library from TypeScript doesn't work as advertised. According to the types file, it should be imported like this:
However, while this compiles, it causes a runtime error:
TypeError: google_play_billing_validator_1.default is not a constructor
It's currently possible to make this work with TypeScript, but it forces the user to force a cast, which defeats the purpose of using types:
Adding the default import syntax would allow the code from the first example to work as advertised, and is also a typical solution (e.g., off the top of my mind, Axios does this).
Types of changes
Documentation: