[core][js] Damerau-Levenshtein distance buggy: can’t find out why -> another version