domainTable function

void domainTable(
  1. List<CheckedDomain> domains
)

Implementation

void domainTable(List<CheckedDomain> domains) {
  if (!stdout.hasTerminal) {
    return stdout.writeln(domains.join('\n'));
  }

  table([
    for (final domain in domains..sort())
      '${(switch (domain.status) {
        CheckStatus.available => '✔'.green(),
        CheckStatus.taken => '⨯'.red(),
        _ => '⁇'.blue(),
      }).bold()} $domain'
  ]);
}