```
/** Melt a row of ice one simultaneous step at a time. */
export function thawRow(row: string, steps: number): string {
  if (typeof row !== "string" || row.length === 0) {
    throw new Error("thawRow expects a non-empty string row");
  }
  if (!/^[#.]*$/.test(row)) {
    throw new Error("thawRow expects only '#' and '.' characters in the row");
  }
  if (!Number.isInteger(steps) || steps < 0) {
    throw new Error("thawRow expects a non-negative whole number of steps");
  }

  const chars = row.split('');
  let hasChanged = true;

  while (steps > 0 && hasChanged) {
    hasChanged = false;
    for (let i = 0; i < chars.length; i++) {
      if (chars[i] === '#') {
        if (i === 0 || i === chars.length - 1 || chars[i - 1] === '.' || chars[i + 1] === '.') {
          chars[i] = '.';
          hasChanged = true;
        }
      }
    }
    steps--;
  }

  return chars.join('');
}
```