Skip to content

Commit 90d2b67

Browse files
committed
chore(cleanup): drop duplicate utils::purl::build_npm_purl
`utils::purl::build_npm_purl` was a byte-identical duplicate of `crawlers::npm_crawler::build_npm_purl`. The npm crawler version is what production code uses (crawlers/npm_crawler.rs:309 and :656 in the discovery loops); nothing imported the utils one. Removed the utils duplicate + its test. The npm-crawler version keeps its own tests. Workspace test sweep stays green (118 + 414 lib tests). Assisted-by: Claude Code:claude-opus-4-7
1 parent 9dabcb9 commit 90d2b67

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

  • crates/socket-patch-core/src/utils

crates/socket-patch-core/src/utils/purl.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,6 @@ pub fn is_purl(s: &str) -> bool {
182182
s.starts_with("pkg:")
183183
}
184184

185-
/// Build an npm PURL from components.
186-
pub fn build_npm_purl(namespace: Option<&str>, name: &str, version: &str) -> String {
187-
match namespace {
188-
Some(ns) => format!("pkg:npm/{}/{name}@{version}", ns),
189-
None => format!("pkg:npm/{name}@{version}"),
190-
}
191-
}
192-
193185
#[cfg(test)]
194186
mod tests {
195187
use super::*;
@@ -229,18 +221,6 @@ mod tests {
229221
assert!(!is_purl("CVE-2024-1234"));
230222
}
231223

232-
#[test]
233-
fn test_build_npm_purl() {
234-
assert_eq!(
235-
build_npm_purl(None, "lodash", "4.17.21"),
236-
"pkg:npm/lodash@4.17.21"
237-
);
238-
assert_eq!(
239-
build_npm_purl(Some("@types"), "node", "20.0.0"),
240-
"pkg:npm/@types/node@20.0.0"
241-
);
242-
}
243-
244224
#[cfg(feature = "cargo")]
245225
#[test]
246226
fn test_parse_cargo_purl() {

0 commit comments

Comments
 (0)