allMatch function

bool allMatch(
  1. String key1,
  2. String key2
)

allMatch determines whether key1 matches the pattern of key2 , key2 can contain a *.

For example, "*" matches everything

Implementation

bool allMatch(String key1, String key2) {
  if ('*' == key1 || '*' == key2) {
    return true;
  }

  return key1 == key2;
}