Recursively extracts import paths from a source file and all its dependencies.
Supports JavaScript, TypeScript, and Rust files.
Handles circular dependencies by tracking visited files.
Parameters
filePath: string
Path to the file to analyze.
visited: Set<string> = ...
Set of already visited files to prevent infinite recursion.
Returns string[]
Array of absolute paths to the provided file and all imported files there (including nested imports).
Throws
If an unexpected error occurs while processing files (not including ENOENT file not found errors).
Recursively extracts import paths from a source file and all its dependencies. Supports JavaScript, TypeScript, and Rust files. Handles circular dependencies by tracking visited files.