MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / lastmodForUrl

Function lastmodForUrl

apps/docs/astro.config.mjs:79–91  ·  view source on GitHub ↗
(absoluteUrl)

Source from the content-addressed store, hash-verified

77const docsLastmod = buildDocsLastmodMap();
78
79function lastmodForUrl(absoluteUrl) {
80 try {
81 const { pathname } = new URL(absoluteUrl);
82 const slug = pathname.replace(/^\/|\/$/g, "") || "index";
83 for (const ext of ["mdx", "md"]) {
84 const candidate = `src/content/docs/${slug}.${ext}`;
85 if (docsLastmod.has(candidate)) {
86 return docsLastmod.get(candidate);
87 }
88 }
89 } catch {}
90 return undefined;
91}
92
93// https://astro.build/config
94export default defineConfig({

Callers 1

serializeFunction · 0.85

Calls 2

hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected