matchesPattern static method

bool matchesPattern(
  1. String filePath,
  2. List<String> patterns
)

Check if a path matches any of the given glob-like patterns

Implementation

static bool matchesPattern(String filePath, List<String> patterns) {
  final normalizedPath = filePath.replaceAll('\\', '/');

  for (final pattern in patterns) {
    if (_matchGlobPattern(normalizedPath, pattern)) {
      return true;
    }
  }
  return false;
}