Skip to content

fix:typescript: set default export#18

Merged
juliangruber merged 1 commit into
juliangruber:masterfrom
alzalabany:patch-1
Apr 12, 2021
Merged

fix:typescript: set default export#18
juliangruber merged 1 commit into
juliangruber:masterfrom
alzalabany:patch-1

Conversation

@alzalabany

Copy link
Copy Markdown
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
Copy Markdown
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