summaryrefslogtreecommitdiff
path: root/cli/file_fetcher.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/file_fetcher.rs')
-rw-r--r--cli/file_fetcher.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs
index 3e3776f24..e16b808d9 100644
--- a/cli/file_fetcher.rs
+++ b/cli/file_fetcher.rs
@@ -146,6 +146,23 @@ impl CacheSetting {
}
}
}
+
+ pub fn should_use_for_npm_package(&self, package_name: &str) -> bool {
+ match self {
+ CacheSetting::ReloadAll => false,
+ CacheSetting::ReloadSome(list) => {
+ if list.contains(&"npm:".to_string()) {
+ return false;
+ }
+ let specifier = format!("npm:{}", package_name);
+ if list.contains(&specifier) {
+ return false;
+ }
+ true
+ }
+ _ => true,
+ }
+ }
}
/// Fetch a source file from the local file system.