determineWhitespace function

String determineWhitespace(
  1. List<String> lines
)

Returns the String used for indentation in List<String> lines.

Implementation

String determineWhitespace(List<String> lines) {
  for (var line in lines) {
    String? match = RegExp(r'^\s+').stringMatch(line);
    if (match != null) {
      return match;
    }
  }
  return '  ';
}