You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2023. It is now read-only.
This looks like expected behavior, but it could be useful to fall back to a simple algorithm if one of the inputs is a length 1 string.
if(first.length===1||second.length===1){// if either is a 1-letter stringlet[smaller,larger]=(first.length===1)
? [first,second]
: [second,first];returnlarger.includes(smaller) ? 2.0/(larger.length+1) : 0;}
This came up when I tried to use compareTwoStrings for a search ranking.
This looks like expected behavior, but it could be useful to fall back to a simple algorithm if one of the inputs is a length 1 string.
This came up when I tried to use
compareTwoStrings
for a search ranking.string-similarity/compare-strings.js
Line 14 in ccdb537
The text was updated successfully, but these errors were encountered: