don't stat() all input files
don't stat() all input files

As part of transpilation we might receive directories as input
files.  To check, we tested each file for whether it was a
directory or not.  This disk access evaded our various caches.

To fix:
1. only check for directories in transpilation;
2. when checking for directories, assume names ending in
   sourc file extensions like ".js" are not directories.

PiperOrigin-RevId: 296473783

bazelbuild/rules_typescript,bazelbuild/rules_typescript,bazelbuild/rules_typescript