Skip to contents

This function parses a path pattern and returns both the name of the parameters and a version of the path formatted for glue string interpolation.

Usage

path_params(path)

Arguments

path

The path pattern to parse

Value

A list with the elements keys containing the names of all the path parameters and glue containing a glue ready version of the path

Examples

path_params("/users/:user/assets/*")
#> $keys
#> [1] "user" "*1"  
#> 
#> $glue
#> [1] "/users/{`user`}/assets/{`*1`}"
#>