js-string-comparison
js-string-comparison copied to clipboard
Extra attribute "default" when importing of the module
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.