(route)
| 56 | } |
| 57 | |
| 58 | function normalizeRoute(route) { |
| 59 | if (!route) return '/'; |
| 60 | let out = route.trim(); |
| 61 | if (!out.startsWith('/')) out = `/${out}`; |
| 62 | out = out.replace(/\/{2,}/g, '/'); |
| 63 | if (out.length > 1) out = out.replace(/\/+$/, ''); |
| 64 | return out; |
| 65 | } |
| 66 | |
| 67 | function defaultRouteFromFile(namespaceRoot, fullPath) { |
| 68 | const rel = path.posix.normalize(path.relative(namespaceRoot, fullPath)).replace(/\\/g, '/'); |
no test coverage detected
searching dependent graphs…