From cb70c4d0c4c97999deef0c13eaf91db635957517 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 17 Oct 2023 00:26:38 +0900 Subject: fix(node): resolve file.d specifiers in npm packages (#20918) Makes type checking octokit work. Closes #20854 --- ext/node/resolution.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/node') 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() { -- cgit v1.2.3