summaryrefslogtreecommitdiff
path: root/ext/node/errors.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-10-04 23:05:12 -0400
committerGitHub <noreply@github.com>2023-10-04 23:05:12 -0400
commit1ff525e25b6ca833893c03f720a1298adffb37db (patch)
treed4e1cff2a413a5355037d4f9664f7a747e98ab57 /ext/node/errors.rs
parent64f9155126b1cd14a46de58ae1654045cfacd150 (diff)
refactor(node): combine node resolution code for resolving a package subpath from external code (#20791)
We had two methods that did the same functionality.
Diffstat (limited to 'ext/node/errors.rs')
-rw-r--r--ext/node/errors.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/node/errors.rs b/ext/node/errors.rs
index e0f02725f..e72cb8557 100644
--- a/ext/node/errors.rs
+++ b/ext/node/errors.rs
@@ -53,8 +53,8 @@ pub fn err_module_not_found(path: &str, base: &str, typ: &str) -> AnyError {
}
pub fn err_invalid_package_target(
- pkg_path: String,
- key: String,
+ pkg_path: &str,
+ key: &str,
target: String,
is_import: bool,
maybe_referrer: Option<String>,
@@ -95,7 +95,7 @@ pub fn err_invalid_package_target(
pub fn err_package_path_not_exported(
mut pkg_path: String,
- subpath: String,
+ subpath: &str,
maybe_referrer: Option<String>,
mode: NodeResolutionMode,
) -> AnyError {
@@ -178,7 +178,7 @@ mod test {
assert_eq!(
err_package_path_not_exported(
"test_path".to_string(),
- "./jsx-runtime".to_string(),
+ "./jsx-runtime",
None,
NodeResolutionMode::Types,
)
@@ -188,7 +188,7 @@ mod test {
assert_eq!(
err_package_path_not_exported(
"test_path".to_string(),
- ".".to_string(),
+ ".",
None,
NodeResolutionMode::Types,
)