parsePattern method

String parsePattern(
  1. String path
)

Implementation

String parsePattern(String path) {
  String get_pattern = "";
  if (path == "/") {
    get_pattern = "^${path}\$";
  } else {
    if (!RegExp(r"^(/)").hasMatch(path)) {
      get_pattern = "^/${path}";
    } else {
      get_pattern = path;
    }
  }
  return get_pattern;
}