Skip to content

Commit

Permalink
fix(node-maintainer): stop failing when root package entry in lockfil…
Browse files Browse the repository at this point in the history
…e is missing package name

Fixes: #267
  • Loading branch information
zkat committed May 19, 2023
1 parent 00979ae commit b7ac680
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions crates/node-maintainer/src/lockfile.rs
Expand Up @@ -382,12 +382,15 @@ impl LockfileNode {
.skip(1)
.map(|s| s.into())
.collect::<Vec<_>>();
let name = npm
.name
.clone()
.map(UniCase::new)
.or_else(|| path.last().cloned())
.ok_or_else(|| NodeMaintainerError::NpmLockMissingName(Box::new(npm.clone())))?;
let name = if path_str.is_empty() {
UniCase::new("".into())
} else {
npm.name
.clone()
.map(UniCase::new)
.or_else(|| path.last().cloned())
.ok_or_else(|| NodeMaintainerError::NpmLockMissingName(Box::new(npm.clone())))?
};
let integrity = npm
.integrity
.as_ref()
Expand Down

0 comments on commit b7ac680

Please sign in to comment.