Function simpleRoutePattern

  • Parses simple route pattern.

    Simple pattern can only match against whole entries. It does not support name prefixes or suffixes.

    Pattern format:

    • Empty string corresponds to empty pattern.

    • / matches directory separator. Corresponds to rmatchDirSep.

    • /* matches any route entry. Corresponds to rmatchEntry.

    • /{capture} captures any route entry as capture. Corresponds to rcaptureEntry.

    • /** matches any number of directories. Corresponds to rmatchDirs

    • /{capture:**} captures any number of directories as capture. Corresponds to rcaptureDirs.

    • Everything else matches verbatim and corresponds to rmatchName.

    The pattern parts are URL-decoded after parsing. So the pattern string may contain URL-encoded reserved and special characters.

    Parameters

    • pattern: string

      Pattern string.

    Returns RoutePattern

    Simple route pattern.

Generated using TypeDoc