diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2023-10-17 00:26:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-17 00:26:38 +0900 |
| commit | cb70c4d0c4c97999deef0c13eaf91db635957517 (patch) | |
| tree | 68d78653dbb1a3b6536eef652a86deb995b6dbab /ext/node/resolution.rs | |
| parent | bd238be4b5f26126fee8820d2a64c6660dfd6b6b (diff) | |
fix(node): resolve file.d specifiers in npm packages (#20918)
Makes type checking octokit work.
Closes #20854
Diffstat (limited to 'ext/node/resolution.rs')
| -rw-r--r-- | ext/node/resolution.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/resolution.rs b/ext/node/resolution.rs index 22ab47ce6..cbe9f643f 100644 --- a/ext/node/resolution.rs +++ b/ext/node/resolution.rs @@ -1378,7 +1378,9 @@ fn is_relative_specifier(specifier: &str) -> bool { /// Alternate `PathBuf::with_extension` that will handle known extensions /// more intelligently. fn with_known_extension(path: &Path, ext: &str) -> PathBuf { - const NON_DECL_EXTS: &[&str] = &["cjs", "js", "json", "jsx", "mjs", "tsx"]; + const NON_DECL_EXTS: &[&str] = &[ + "cjs", "js", "json", "jsx", "mjs", "tsx", /* ex. types.d */ "d", + ]; const DECL_EXTS: &[&str] = &["cts", "mts", "ts"]; let file_name = match path.file_name() { |
