(base: string)
| 72 | */ |
| 73 | export function nextProxyFor(context: ResolutionContext, dir: string, root: string): NextProxy | null { |
| 74 | const find = (base: string): string | undefined => |
| 75 | PROXY_EXTENSIONS.map((ext) => `${dir}${base}.${ext}`).find((file) => context.fileExists(file)); |
| 76 | const middleware = find('middleware'); |
| 77 | const proxy = middleware ? undefined : find('proxy'); |
| 78 | const file = middleware ?? (proxy && !pinsNextBefore16(context, root) ? proxy : undefined); |
no test coverage detected