Improve handling of import paths versus file paths.
Improve handling of import paths versus file paths.

There isn't a one to one mapping of ts import paths to file paths.  A import path of "google3/foo/bar" could be from "foo/bar.ts" or "foo/bar.d.ts" or foo/bar/index.ts" or several others.  The query-based analyzer has to issue a query looking for all the possible files for an import, then match the files found to the import path.

This cl improves the matching from found files back to import paths by consistently using a single function to generate all the possibilities, and matching against all of them, instead of trying to normalize a file path back into an import path.  Fixes a bug where the query based analyzer couldn't find an import that was both named index and an ngsummary.

PiperOrigin-RevId: 233083622

bazelbuild/rules_typescript,bazelbuild/rules_typescript,bazelbuild/rules_typescript