matchesKey static method

bool matchesKey(
  1. List candidateKey,
  2. List prefix
)

Checks whether a candidateKey matches a given prefix key list.

Example:

BloomData.matchesKey(['users', 42, 'profile'], ['users', 42]); // true

Implementation

static bool matchesKey(List<dynamic> candidateKey, List<dynamic> prefix) {
  if (prefix.isEmpty) return true;
  if (candidateKey.length < prefix.length) return false;
  for (int i = 0; i < prefix.length; i++) {
    if (_canonical(candidateKey[i]) != _canonical(prefix[i])) {
      return false;
    }
  }
  return true;
}