We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aedb072 commit 72e364aCopy full SHA for 72e364a
src/commands/optimize.ts
@@ -192,11 +192,12 @@ const lsByAgent = (() => {
192
return ''
193
}
194
const names = new Set<string>()
195
- for (const { name, pkgid = '' } of pkgs) {
+ for (const { _id, name, pkgid } of pkgs) {
196
// `npm query` results may not have a "name" property, in which case we
197
- // fallback to "pkgid".
+ // fallback to "_id" and then "pkgid".
198
// `vlt ls --view json` results always have a "name" property.
199
- const resolvedName = name ?? pkgid.slice(0, pkgid.indexOf('@', 1))
+ const fallback = _id ?? pkgid ?? ''
200
+ const resolvedName = name ?? fallback.slice(0, fallback.indexOf('@', 1))
201
if (resolvedName) {
202
names.add(resolvedName)
203
0 commit comments