Extra attribute "default" when importing of the module
Opened this issue · 1 comments
Yettobecoder commented
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 commented
Because this is an es6 module https://github.com/Rabbitzzc/js-string-comparison/blob/master/src/index.ts#L34
I will fix it..