CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.9.0 (changelog, source)

Predicate getFileExtensionPriority

Gets the priority with which a given file extension should be found by module resolution. Extensions with a lower numeric priority value are preferred.

File types that compile to js are preferred over the js file type itself. This is to ensure we find the original source file in case the compiled output is also present.

Import path

import semmle.javascript.NodeModuleResolutionImpl
int getFileExtensionPriority(string ext)