(moduleNs: unknown)
| 169 | } |
| 170 | |
| 171 | function defaultResolveRoutes<S>(moduleNs: unknown): readonly RouteDefinition<S>[] { |
| 172 | if (!isRecord(moduleNs)) { |
| 173 | throw new Error("HSR routes module must export a named `routes` array or a default array"); |
| 174 | } |
| 175 | const moduleExports = moduleNs as { routes?: unknown; default?: unknown }; |
| 176 | if (moduleExports.routes !== undefined) { |
| 177 | return coerceRoutesExport<S>(moduleExports.routes); |
| 178 | } |
| 179 | if (moduleExports.default !== undefined) { |
| 180 | return coerceRoutesExport<S>(moduleExports.default); |
| 181 | } |
| 182 | throw new Error("HSR routes module must export a named `routes` array or a default array"); |
| 183 | } |
| 184 | |
| 185 | function containsIgnoredDir(absPath: string): boolean { |
| 186 | const normalized = absPath.replace(/\\/g, "/"); |
nothing calls this directly
no test coverage detected