Skip to content

fix: type definitions for use with require#24

Open
Gozala wants to merge 1 commit into
dominictarr:masterfrom
Gozala:patch-1
Open

fix: type definitions for use with require#24
Gozala wants to merge 1 commit into
dominictarr:masterfrom
Gozala:patch-1

Conversation

@Gozala

@Gozala Gozala commented Oct 20, 2020

Copy link
Copy Markdown

This pull request fixes typedefs so that module does not pretends to be a ES module, which causes problems like this:

image

And misleads users to do require('hashlru').default instead, which than breaks at runtime because there is no exports.default.

Suggested syntax is recognized by TS as CommonJS module, which works as expected when importing from commonjs and also works correctly when imported from TS / ESM models if esModuleInterop: true is set in tsconfig.json

@Gozala Gozala mentioned this pull request Dec 9, 2020
1 task
@achingbrain

Copy link
Copy Markdown

@dominictarr it would be great if this could be merged, types are completely broken with node16 moduleResolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants