matchPart static method

bool matchPart(
  1. String? globPart,
  2. String? part
)

Check single part.

  • The ? matches 1 of any character in a single path portion
  • The * matches 0 or more of any character in a single path portion
  • If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches.

Implementation

static bool matchPart(String? globPart, String? part) {
  if (part == null) {
    return globPart == null;
  }
  final runner = _PartMatchRunner()
    ..glob = globPart
    ..part = part;
  return runner.matches();
}