Skip to main content

try_resolve_with_extensions

Function try_resolve_with_extensions 

Source
fn try_resolve_with_extensions(base_path: &Path) -> Option<PathBuf>
Expand description

Tries to resolve a path by checking various file extensions. Handles three cases:

  1. Path already has a valid extension (e.g., .js, .ts) - use as-is
  2. Path has a partial extension (e.g., .stylex) - append additional extensions
  3. Path has no extension - try each extension

Returns Some(path) if a valid file is found, None otherwise.