toFrontmatterString method

String toFrontmatterString()

Encodes a relation as a compact frontmatter string: type|target or type|target|weight.

Implementation

String toFrontmatterString() {
  final base = '$type|$target';
  if (weight != 1.0) return '$base|${weight.toStringAsFixed(2)}';
  return base;
}