Home / Function/ escapeRegex() — astro Function Reference

escapeRegex() — astro Function Reference

Architecture documentation for the escapeRegex() function in redirects.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  1af7fd3e_e678_b33e_6570_2ec1ee608783["escapeRegex()"]
  2eae0c6b_820a_2609_b99a_dfcd5eb248a7["redirects.ts"]
  1af7fd3e_e678_b33e_6570_2ec1ee608783 -->|defined in| 2eae0c6b_820a_2609_b99a_dfcd5eb248a7
  47a1f327_a4c1_9abf_7757_611071f34980["getParts()"]
  1af7fd3e_e678_b33e_6570_2ec1ee608783 -->|calls| 47a1f327_a4c1_9abf_7757_611071f34980
  4f26bee2_4f80_e528_cf37_94da7aeecde4["getMatchRegex()"]
  1af7fd3e_e678_b33e_6570_2ec1ee608783 -->|calls| 4f26bee2_4f80_e528_cf37_94da7aeecde4
  style 1af7fd3e_e678_b33e_6570_2ec1ee608783 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/vercel/src/lib/redirects.ts lines 111–119

export function escapeRegex(content: string) {
	const segments = removeLeadingForwardSlash(content)
		.split(nodePath.posix.sep)
		.filter(Boolean)
		.map((s: string) => {
			return getParts(s, content);
		});
	return `^/${getMatchRegex(segments)}$`;
}

Domain

Subdomains

Frequently Asked Questions

What does escapeRegex() do?
escapeRegex() is a function in the astro codebase, defined in packages/integrations/vercel/src/lib/redirects.ts.
Where is escapeRegex() defined?
escapeRegex() is defined in packages/integrations/vercel/src/lib/redirects.ts at line 111.
What does escapeRegex() call?
escapeRegex() calls 2 function(s): getMatchRegex, getParts.

Analyze Your Own Codebase

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

Try Supermodel Free