aceakash / string-similarity

Finds degree of similarity between two strings, based on Dice's Coefficient, which is mostly better than Levenshtein distance.
MIT License
2.52k stars 124 forks source link

first.replace is not a function #82

Open ghost opened 3 years ago

ghost commented 3 years ago

All in the title.

RiccardoManzan commented 3 years ago

Similar here, i got "second.replace is not a function" in compareTwoStrings()

Any thoughts?

Edit: My fault, i was passing a null value sometimes, "fixed" adding || "" after the variables

ianengelbrecht commented 3 years ago

Suggested to update the docs to say that string 1 and string 2 passed to compareTwoStrings() must not be null, or check the vals passed in and throw an error if either null rather than relying on the error throw by null.replace().