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

Extra attribute "default" when importing of the module #18

Open
Yettobecoder opened this issue Oct 30, 2024 · 1 comment
Open

Extra attribute "default" when importing of the module #18

Yettobecoder opened this issue Oct 30, 2024 · 1 comment

Comments

@Yettobecoder
Copy link

let stringComparison = require('string-comparison').default;

// Log to see the structure of the cos object
console.log(Object.keys(stringComparison));

// output
[
  'cosine',
  'diceCoefficient',
  'jaccardIndex',
  'levenshtein',
  'lcs',
  'longestCommonSubsequence',
  'mlcs',
  'metricLcs',
  'jaroWinkler'
]

The module is not properly imported without the '.default' attribute. Maybe it's only a non-typeScript issue, but it's worth noting.

@Rabbitzzc
Copy link
Owner

Because this is an es6 module https://github.com/Rabbitzzc/js-string-comparison/blob/master/src/index.ts#L34

I will fix it..

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