Skip to main content

extract_module_name

Function extract_module_name 

Source
pub fn extract_module_name(
    file_path: &str,
    index_names: &[&str],
) -> Option<String>
Expand description

Extract module name from a file path.

This is a shared helper for all language parsers. The index_names parameter specifies which file stems should use the parent directory name instead (e.g., “index” for TypeScript, “init” for Python, “mod” for Rust).