path_to_regexp library
Classes
- ParameterToken
- Corresponds to a parameter of a path specification.
- PathToken
- Corresponds to a non-parameterized section of a path specification.
- Token
- The base type of all tokens produced by a path specification.
Functions
-
extract(
List< String> parameters, Match match) → Map<String, String> -
Extracts arguments from
match
and maps them by parameter name. -
parse(
String path, {List< String> ? parameters}) → List<Token> -
Parses a
path
specification. -
pathToFunction(
String path) → PathFunction -
Creates a PathFunction from a
path
specification. -
pathToRegExp(
String path, {List< String> ? parameters, bool prefix = false, bool caseSensitive = true}) → RegExp -
Creates a RegExp that matches a
path
specification. -
tokensToFunction(
List< Token> tokens) → PathFunction -
Creates a PathFunction from
tokens
. -
tokensToRegExp(
List< Token> tokens, {bool prefix = false, bool caseSensitive = true}) → RegExp -
Creates a RegExp from
tokens
.
Typedefs
-
PathFunction
= String Function(Map<
String, String> args) -
Generates a path by populating a path specification with
args
.