[core][js] fix Damerau-Levenshtein distance