summaryrefslogtreecommitdiff
path: root/ext/node
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-10-17 00:26:38 +0900
committerGitHub <noreply@github.com>2023-10-17 00:26:38 +0900
commitcb70c4d0c4c97999deef0c13eaf91db635957517 (patch)
tree68d78653dbb1a3b6536eef652a86deb995b6dbab /ext/node
parentbd238be4b5f26126fee8820d2a64c6660dfd6b6b (diff)
fix(node): resolve file.d specifiers in npm packages (#20918)
Makes type checking octokit work. Closes #20854
Diffstat (limited to 'ext/node')
-rw-r--r--ext/node/resolution.rs4
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() {