isValidPath function

bool isValidPath(
  1. String path
)

Implementation

bool isValidPath(String path) {
  if (!RegExp(pathRegex).hasMatch(path)) {
    return false;
  }
  return !path
      .split("/")
      .sublist(1)
      .map(replaceDerive)
      .any((e) => int.tryParse(e) == null);
}