package jerboa

  1. Overview
  2. Docs

Jerboa.Path contains the type definition of the Path record and also a variety of constructors.

type t = {
  1. name : string option;
  2. regex : Re.t;
}

Path.t is a record, which has a name part used for variable captring and a regex used for matching the path part.

val create_const : Re.t -> t

Path.create_const regex creates a path part, which won't be captured as a path variable:

  • regex: regex defines the wanted path part
val create_var : string -> Re.t -> t

Path.create_var name regex create a path variable, which captures a path argument based on:

  • name: this will be the name of the captured path argument
  • regex: defines the value to be captured
val anytihng : Re.t

Path.anything is a regex, which matches anything in the path part.

val const : string -> t

Path.const path_part creates a simple path part based on:

  • path_part: string based path part
val var : string -> t

Path.var name create a path variable wich will capture the whole path part based on:

  • name: name of the path variable
val separator : t
val split_into_path_parts : string -> string list
OCaml

Innovation. Community. Security.