Home / Function/ isFileReadable() — astro Function Reference

isFileReadable() — astro Function Reference

Architecture documentation for the isFileReadable() function in searchRoot.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  3458c191_918d_8674_45e4_2ce7b6917eaf["isFileReadable()"]
  f146dc60_74d2_b1d6_cb66_a8216ff4ea82["searchRoot.ts"]
  3458c191_918d_8674_45e4_2ce7b6917eaf -->|defined in| f146dc60_74d2_b1d6_cb66_a8216ff4ea82
  b9482f7f_1dfc_7fbc_d27c_84c79b91ee61["hasWorkspacePackageJSON()"]
  b9482f7f_1dfc_7fbc_d27c_84c79b91ee61 -->|calls| 3458c191_918d_8674_45e4_2ce7b6917eaf
  d5253abc_b683_1945_9363_e06c6af0d618["tryStatSync()"]
  3458c191_918d_8674_45e4_2ce7b6917eaf -->|calls| d5253abc_b683_1945_9363_e06c6af0d618
  style 3458c191_918d_8674_45e4_2ce7b6917eaf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/vercel/src/lib/searchRoot.ts lines 36–49

function isFileReadable(filename: string): boolean {
	if (!tryStatSync(filename)) {
		return false;
	}

	try {
		// Check if current process has read permission to the file
		fs.accessSync(filename, fs.constants.R_OK);

		return true;
	} catch {
		return false;
	}
}

Domain

Subdomains

Frequently Asked Questions

What does isFileReadable() do?
isFileReadable() is a function in the astro codebase, defined in packages/integrations/vercel/src/lib/searchRoot.ts.
Where is isFileReadable() defined?
isFileReadable() is defined in packages/integrations/vercel/src/lib/searchRoot.ts at line 36.
What does isFileReadable() call?
isFileReadable() calls 1 function(s): tryStatSync.
What calls isFileReadable()?
isFileReadable() is called by 1 function(s): hasWorkspacePackageJSON.

Analyze Your Own Codebase

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

Try Supermodel Free