MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / normalizeRoute

Function normalizeRoute

docs/scripts/rewrite-doc-links.mjs:58–65  ·  view source on GitHub ↗
(route)

Source from the content-addressed store, hash-verified

56}
57
58function 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
67function defaultRouteFromFile(namespaceRoot, fullPath) {
68 const rel = path.posix.normalize(path.relative(namespaceRoot, fullPath)).replace(/\\/g, '/');

Callers 3

defaultRouteFromFileFunction · 0.85
buildLookupCandidatesFunction · 0.85
mainFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…