Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeScript] Incorrectly declared types #18

Closed
hakimio opened this issue Jun 8, 2020 · 2 comments
Closed

[TypeScript] Incorrectly declared types #18

hakimio opened this issue Jun 8, 2020 · 2 comments

Comments

@hakimio
Copy link

hakimio commented Jun 8, 2020

The current type definition results in an error when using library with TypeScript:
TypeError: klona.default is not a function

To fix this error, type definitions should be changed to the following:

export = klona;
declare function klona<T>(val: T): T

Just like dayjs does it.
More info about the error.

@lukeed lukeed closed this as completed in 0d324fe Jul 3, 2020
@hakimio
Copy link
Author

hakimio commented Aug 6, 2020

@lukeed
Now trying to import klona, results in an error saying: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. The fix didn't fix anything.

@lukeed
Copy link
Owner

lukeed commented Aug 6, 2020

It did fix things in some instances -- but it broke others. Will be addressed in next release.

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

No branches or pull requests

2 participants