Home / Function/ isStatusCodePage() — astro Function Reference

isStatusCodePage() — astro Function Reference

Architecture documentation for the isStatusCodePage() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  9804c61c_5b2d_f65a_7831_05c44a8cef26["isStatusCodePage()"]
  79573a16_7c46_af8f_5c1d_ea09d9ca9085["index.ts"]
  9804c61c_5b2d_f65a_7831_05c44a8cef26 -->|defined in| 79573a16_7c46_af8f_5c1d_ea09d9ca9085
  1bbd6d7d_7355_b89b_685e_873720d72418["createPlugin()"]
  1bbd6d7d_7355_b89b_685e_873720d72418 -->|calls| 9804c61c_5b2d_f65a_7831_05c44a8cef26
  style 9804c61c_5b2d_f65a_7831_05c44a8cef26 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/sitemap/src/index.ts lines 65–81

const isStatusCodePage = (locales: string[]) => {
	const statusPathNames = new Set(
		locales
			.flatMap((locale) => [...STATUS_CODE_PAGES].map((page) => `${locale}/${page}`))
			.concat([...STATUS_CODE_PAGES]),
	);

	return (pathname: string): boolean => {
		if (pathname.endsWith('/')) {
			pathname = pathname.slice(0, -1);
		}
		if (pathname.startsWith('/')) {
			pathname = pathname.slice(1);
		}
		return statusPathNames.has(pathname);
	};
};

Domain

Subdomains

Called By

Frequently Asked Questions

What does isStatusCodePage() do?
isStatusCodePage() is a function in the astro codebase, defined in packages/integrations/sitemap/src/index.ts.
Where is isStatusCodePage() defined?
isStatusCodePage() is defined in packages/integrations/sitemap/src/index.ts at line 65.
What calls isStatusCodePage()?
isStatusCodePage() is called by 1 function(s): createPlugin.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free