js-string-comparison icon indicating copy to clipboard operation
js-string-comparison copied to clipboard

Extra attribute "default" when importing of the module

Open Yettobecoder opened this issue 1 year ago • 1 comments

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.

Yettobecoder avatar Oct 30 '24 09:10 Yettobecoder