Home / Function/ isEmpty() — astro Function Reference

isEmpty() — astro Function Reference

Architecture documentation for the isEmpty() function in shared.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  45ac19d1_b568_bbb9_757c_9cc7c45dc354["isEmpty()"]
  a889965c_1012_004b_402e_d9c7a19cb67b["shared.ts"]
  45ac19d1_b568_bbb9_757c_9cc7c45dc354 -->|defined in| a889965c_1012_004b_402e_d9c7a19cb67b
  style 45ac19d1_b568_bbb9_757c_9cc7c45dc354 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/create-astro/src/actions/shared.ts lines 30–42

export function isEmpty(dirPath: string) {
	if (!fs.existsSync(dirPath)) {
		return true;
	}

	const conflicts = fs.readdirSync(dirPath).filter((content) => {
		return !VALID_PROJECT_DIRECTORY_SAFE_LIST.some((safeContent) => {
			return typeof safeContent === 'string' ? content === safeContent : safeContent.test(content);
		});
	});

	return conflicts.length === 0;
}

Domain

Subdomains

Frequently Asked Questions

What does isEmpty() do?
isEmpty() is a function in the astro codebase, defined in packages/create-astro/src/actions/shared.ts.
Where is isEmpty() defined?
isEmpty() is defined in packages/create-astro/src/actions/shared.ts at line 30.

Analyze Your Own Codebase

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

Try Supermodel Free