Fix TypeScript definitions for TS 4.5 nodenext mode#15
Fix TypeScript definitions for TS 4.5 nodenext mode#15FossPrime wants to merge 1 commit intoseald:masterfrom
Conversation
|
Updated with a sandbox that highlights the problem. |
|
Found another workaround I still hold that this PR is the best solution to the issue. It causes the index.js default to work as default under TS. Alternative solution, that makes Nedb available to TS ESM users, but exposes a non existent Datastore property to all CJS users. |
|
@rayfoss I am sorry but I am not very clear on what the problem is. I just tried a quick demo of using NeDB with TypeScript, and it seems to work fine with I tried reading through your sandbox, but between ts-node, nodemon, http stuff, ..., i could not really understand what does not work. EDIT: Also, it does not work with your change if I do not put the |
|
TypeStrong is kicking the can on ESM support... probably till 4.6 or 4.7, or maybe even 5 :( |
The previous definition only worked because of an optional compatibility layer that makes CommonJS look like native ESM.
Workaround