cockpitFuzzyTextMatches function

bool cockpitFuzzyTextMatches(
  1. String actual,
  2. String expected
)

Implementation

bool cockpitFuzzyTextMatches(String actual, String expected) {
  final normalizedExpected = _normalizeFuzzyText(expected);
  if (normalizedExpected.isEmpty) return false;
  if (normalizedExpected.runes.length < 3) {
    return _normalizeFuzzyText(actual) == normalizedExpected;
  }
  return cockpitFuzzyTextSimilarity(actual, expected) >=
      cockpitFuzzyTextMatchThreshold;
}