MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / defaultResolveRoutes

Function defaultResolveRoutes

packages/node/src/dev/hotStateReload.ts:171–183  ·  view source on GitHub ↗
(moduleNs: unknown)

Source from the content-addressed store, hash-verified

169}
170
171function 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
185function containsIgnoredDir(absPath: string): boolean {
186 const normalized = absPath.replace(/\\/g, "/");

Callers

nothing calls this directly

Calls 2

coerceRoutesExportFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected