isSubPath function

bool isSubPath(
  1. String parent,
  2. String child
)

Returns true if child is a sub-path of parent.

Implementation

bool isSubPath(String parent, String child) {
  final np = normalizePath(parent);
  final nc = normalizePath(child);
  if (nc == np) return true;
  return nc.startsWith('$np/');
}