Commit f24d3b8b authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

WIP: Don't exclude .d.ts from matching

parent 67ff7127
...@@ -941,7 +941,7 @@ impl Pattern { ...@@ -941,7 +941,7 @@ impl Pattern {
Regex::new(r"(/|^)(ROOT|\.|/|(node_modules|__tests?__)(/|$))").unwrap() Regex::new(r"(/|^)(ROOT|\.|/|(node_modules|__tests?__)(/|$))").unwrap()
}); });
static FORBIDDEN_MATCH: LazyLock<Regex> = static FORBIDDEN_MATCH: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"\.d\.ts$|\.map$").unwrap()); LazyLock::new(|| Regex::new(r"\.map$").unwrap());
if in_node_modules == InNodeModules::FolderSlashMatched if in_node_modules == InNodeModules::FolderSlashMatched
|| (in_node_modules == InNodeModules::FolderMatched && value.starts_with('/')) || (in_node_modules == InNodeModules::FolderMatched && value.starts_with('/'))
{ {
...@@ -1043,7 +1043,7 @@ impl Pattern { ...@@ -1043,7 +1043,7 @@ impl Pattern {
Regex::new(r"(/|^)(ROOT|\.|/|(node_modules|__tests?__)(/|$))").unwrap() Regex::new(r"(/|^)(ROOT|\.|/|(node_modules|__tests?__)(/|$))").unwrap()
}); });
static FORBIDDEN_MATCH: LazyLock<Regex> = static FORBIDDEN_MATCH: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"\.d\.ts$|\.map$").unwrap()); LazyLock::new(|| Regex::new(r"\.map$").unwrap());
if in_node_modules == InNodeModules::FolderSlashMatched if in_node_modules == InNodeModules::FolderSlashMatched
|| (in_node_modules == InNodeModules::FolderMatched && value.starts_with('/')) || (in_node_modules == InNodeModules::FolderMatched && value.starts_with('/'))
{ {
...@@ -1171,7 +1171,7 @@ impl Pattern { ...@@ -1171,7 +1171,7 @@ impl Pattern {
Regex::new(r"(/|^)(\.|(node_modules|__tests?__)(/|$))").unwrap() Regex::new(r"(/|^)(\.|(node_modules|__tests?__)(/|$))").unwrap()
}); });
static FORBIDDEN_MATCH: LazyLock<Regex> = static FORBIDDEN_MATCH: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"\.d\.ts$|\.map$").unwrap()); LazyLock::new(|| Regex::new(r"\.map$").unwrap());
if let Some(m) = FORBIDDEN.find(value) { if let Some(m) = FORBIDDEN.find(value) {
NextConstantUntilResult::Consumed(value, Some(m.start())) NextConstantUntilResult::Consumed(value, Some(m.start()))
} else if FORBIDDEN_MATCH.find(value).is_some() { } else if FORBIDDEN_MATCH.find(value).is_some() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment