parsePattern method

String parsePattern(
  1. String path
)

Implementation

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