Skip to main content

is_module

Function is_module 

Source
pub fn is_module(program: &Program<'_>) -> bool
Expand description

Detect whether a file is a TypeScript “script” or “module”.

A file is a module if any top-level statement is an import or export. Script files have all top-level declarations in global scope. Module files have declarations local to the file — only declare global {} blocks affect the global scope.