Home / Function/ stripBase() — astro Function Reference

stripBase() — astro Function Reference

Architecture documentation for the stripBase() function in util.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  9626002b_4e19_6508_ee81_84cdbb5750fa["stripBase()"]
  fdaa8bba_d4f1_8642_5787_5bbf1bd2e556["util.ts"]
  9626002b_4e19_6508_ee81_84cdbb5750fa -->|defined in| fdaa8bba_d4f1_8642_5787_5bbf1bd2e556
  style 9626002b_4e19_6508_ee81_84cdbb5750fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/preview/util.ts lines 13–19

export function stripBase(path: string, base: string): string {
	if (path === base) {
		return '/';
	}
	const baseWithSlash = base.endsWith('/') ? base : base + '/';
	return path.replace(RegExp('^' + baseWithSlash), '/');
}

Domain

Subdomains

Frequently Asked Questions

What does stripBase() do?
stripBase() is a function in the astro codebase, defined in packages/astro/src/core/preview/util.ts.
Where is stripBase() defined?
stripBase() is defined in packages/astro/src/core/preview/util.ts at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free