You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/commands/view.js
+1-7Lines changed: 1 addition & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -240,18 +240,12 @@ class View extends BaseCommand {
240
240
})
241
241
242
242
if(json){
243
-
// TODO(BREAKING_CHANGE): all unwrapping should be removed.
244
-
// Users should know based on their arguments if they can expect an array or an object.
245
-
// And this unwrapping can break that assumption.
246
-
// e.g. `npm view abbrev@^2` should always return an array, but currently since there is only one version matching `^2` this will return a single object instead.
243
+
// Users can expect an array .
247
244
constfirst=Object.keys(res[0]||{})
248
245
constjsonRes=first.length===1 ? res.map(m=>m[first[0]]) : res
0 commit comments