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

fix:typescript: set default export #18

Merged
merged 1 commit into from
Apr 12, 2021
Merged

fix:typescript: set default export #18

merged 1 commit into from
Apr 12, 2021

Conversation

alzalabany
Copy link
Contributor

javascript use module.exports = function (opts) { which is equivalent to default export in typescript;

-keypair is not exported as named export in javascript

in typescript if lib. is imported using:

  • import {keypair} form 'keypair'} which cause "keypair.keypair is not a function" error
  • import * as keypair from 'keypair' will throw typescript error; keypair is not a function
  • import keypair from 'keypair'; will result in 'keypair doesnot have default export' error;

this pull request export keypair as default export; i kept named export as is in case it was placed there for a future reason!

javascript use `module.exports = function (opts) {` which is equivalent to default export in typescript; infact keypair is not exported as named export in javascript.
@juliangruber juliangruber merged commit b0360f6 into juliangruber:master Apr 12, 2021
@juliangruber
Copy link
Owner

Thanks for the explanation 🙌 https://github.com/juliangruber/keypair/releases/tag/v1.0.3

@alzalabany alzalabany deleted the patch-1 branch April 28, 2021 23:13
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