function minDistance(
  string,
  list,
) {
  const arrayStrings = distanceList(string, list);
  return arrayStrings.length === 0 ? string.length : arrayStrings.reduce(
    (min, b) => Math.min(min, b.distance),
    arrayStrings[0].distance,
  );
}
/**  Get the minimum Damerau-Levenshtein distance between a string and an array of strings*/
Get the minimum Damerau-Levenshtein distance between a string and an array of strings
Get the minimum Damerau - Levenshtein distance between a string and an array of strings
function minDistance(
  string,
  list,
) {
  const arrayStrings = distanceList(string, list);
  return arrayStrings.length === 0 ? string.length : arrayStrings.reduce(
    (min, b) => Math.min(min, b.distance),
    arrayStrings[0].distance,
  );
}
function minDistance ( string , list , ) { const arrayStrings = distanceList ( string , list ) ; return arrayStrings . length === 0 ? string . length : arrayStrings . reduce ( ( min , b ) => Math . min ( min , b . distance ) , arrayStrings [ 0 ] . distance , ) ; }
Get the minimum Damerau-Levenshtein distance between a string and an array of strings
Get the minimum Damerau - Levenshtein distance between a string and an array of strings