normalizeTrKey function

String normalizeTrKey(
  1. String key,
  2. FlattenKeyStyle style
)

Normalizes a lookup key to the canonical format used at codegen.

Implementation

String normalizeTrKey(String key, FlattenKeyStyle style) {
  if (key.isEmpty) {
    return key;
  }

  final segments = key.contains('.') ? key.split('.') : <String>[key];
  return buildFlattenKey(segments, style);
}