segments static method

List<String> segments(
  1. String path
)

Splits a path into segments.

Implementation

static List<String> segments(String path) {
  path = path.startsWith("/") ? path.substring(1) : path;
  return RegExp(_pathRegs).hasMatch(path) ? path.split("/") : [];
}