sanitizeRoutePath function

String sanitizeRoutePath(
  1. String path
)

Implementation

String sanitizeRoutePath(String path) {
  /// most paths are already clean, like `/` or `/api/users`.
  /// skip the two regex calls for them.
  if (_isClean(path)) return path;
  path = path.replaceAll(_slashes, '/');
  return "/${path.replaceAll(_edgeSlashes, '')}";
}