Skip to content

Commit

Permalink
fix: allow remote modules in FilesConfig::matches_specifier() (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeemrmn authored Sep 9, 2023
1 parent bb552f1 commit 367f8b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl FilesConfig {
pub fn matches_specifier(&self, specifier: &Url) -> bool {
let file_path = match util::specifier_to_file_path(specifier) {
Ok(file_path) => file_path,
Err(_) => return false,
Err(_) => return true,
};
// Skip files which is in the exclude list.
if self.exclude.iter().any(|i| file_path.starts_with(i)) {
Expand Down Expand Up @@ -1550,6 +1550,12 @@ mod tests {
);
}

#[test]
fn files_config_matches_remote() {
assert!(FilesConfig::default()
.matches_specifier(&Url::parse("https://example.com/mod.ts").unwrap()));
}

#[test]
fn resolve_lockfile_path_from_unix_path() {
let config_file =
Expand Down

0 comments on commit 367f8b1

Please sign in to comment.