pathContainsComponent function

bool pathContainsComponent(
  1. String path,
  2. Set<String> components
)

Checks if the provided path contains any of the specified components. This operation is case-insensitive.

Implementation

bool pathContainsComponent(String path, Set<String> components) {
  final localSystemFilePath = toLocalSystemPathFormat(path);
  final a = p.split(localSystemFilePath).map((e) => e.toLowerCase());
  for (final component in components) {
    if (a.contains(component.toLowerCase())) {
      return true;
    }
  }
  return false;
}