valueMatches static method

bool valueMatches(
  1. String expected,
  2. String got
)

got holds expected: literally, after a formatter-tolerant squash (case, whitespace, separators: "ABCDE1234F" / "12 34" / "₹5,00,000"), or as a masked echo of the same structure ("XXXX XXXX 9012").

Implementation

static bool valueMatches(String expected, String got) {
  if (expected.isEmpty) return got.isEmpty;
  if (got == expected) return true;
  final se = LabelMatch.squash(expected);
  final sg = LabelMatch.squash(got);
  if (se.isNotEmpty && se == sg) return true;
  return _maskedMatch(expected, got);
}