Skip to main content

read_source_file

Function read_source_file 

Source
pub fn read_source_file(path: &Path) -> FileReadResult
Expand description

Read a source file, detecting binary files that should emit TS1490.

TypeScript detects binary files by checking for:

  • UTF-16 BOM (FE FF for BE, FF FE for LE)
  • Non-valid UTF-8 sequences
  • Many control bytes (not expected in source files)
  • Files with many null bytes