( src: string, path: string, env?: Record<string, string | undefined> )
| 10 | |
| 11 | // a simple version of what devRouter does |
| 12 | function buildTransformCtx( |
| 13 | src: string, |
| 14 | path: string, |
| 15 | env?: Record<string, string | undefined> |
| 16 | ) { |
| 17 | const keys: string[] = []; |
| 18 | const matcher = PCRE(`%${src}%i`, keys); |
| 19 | const match = matcher.exec(path) || matcher.exec(path.substring(1)); |
| 20 | return { match: match ?? [], keys, env }; |
| 21 | } |
| 22 | |
| 23 | describe('resolveTransforms', () => { |
| 24 | it('resolves request.path groups', () => { |