isIgnored method

bool isIgnored(
  1. String path, {
  2. bool isDirectory = false,
})

Returns true if the given path would be ignored by the parsed rules.

If isDirectory is true, directory-only rules are considered.

Implementation

bool isIgnored(String path, {bool isDirectory = false}) {
  var ignored = false;
  for (final rule in _rules) {
    if (rule.directoryOnly && !isDirectory) continue;
    if (rule.pattern.match(path)) {
      ignored = !rule.negated;
    }
  }
  return ignored;
}