(route: Route)
| 17 | const NON_EXACT_END = `${WILDCARD}(?=${PATH_END}|${END})`; // match WILDCARD followed by PATH_END or END |
| 18 | |
| 19 | export function getPathSegments(route: Route): string[] { |
| 20 | const sanitizedPath = route.path.replace(/^\//, '').replace(/(?:\/$)/, ''); |
| 21 | return sanitizedPath ? sanitizedPath.split('/') : []; |
| 22 | } |
| 23 | |
| 24 | export const parsePath = (route: Route): RegExp => { |
| 25 | const segments = getPathSegments(route); |
no test coverage detected