Options
All
  • Public
  • Public/Protected
  • All
Menu

Module pathToRegex

import pathToRegex from 'u-http-server/util/pathToRegex';
example
> pathToRegex('/prefix/:category/:page')
{
 regex: '^\/prefix\/([^/]+)\/([^/]+)$',
 keyToIndex: {category: 1, page: 2}
}

Callable

  • pathToRegex(path: string): Return
  • this function transform a /path/:id into a regex (and map for index group to index name)

    Parameters

    • path: string

    Returns Return

Index

Interfaces

Generated using TypeDoc