dmxSnakeCase function

String dmxSnakeCase(
  1. String name
)

The Dart file name for a type: CurrencyDetail gives currency_detail.

The .dart suffix is the caller's business — a macro naming a file adds it itself dartmacros.files. Mirrors casing::snake.

Implementation

String dmxSnakeCase(String name) =>
    [for (final word in dmxWords(name)) word.toLowerCase()].join('_');