Skip to content

Commit

Permalink
view: always use arrays for versions, maintainers, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenany authored and iarna committed Jun 26, 2015
1 parent ba6bdc7 commit 5bff65b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,7 @@ function printData (data, name, cb) {
}
function cleanup (data) {
if (Array.isArray(data)) {
if (data.length === 1) {
data = data[0]
} else {
return data.map(cleanup)
}
return data.map(cleanup)
}
if (!data || typeof data !== "object") return data

Expand Down
2 changes: 1 addition & 1 deletion test/tap/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ test("npm view <package name> --json", function(t) {
try {
var out = JSON.parse(stdout.trim())
t.similar(out, {
maintainers: "jashkenas <[email protected]>"
maintainers: ["jashkenas <[email protected]>"]
}, "should have the same maintainer")
}
catch (er) {
Expand Down

0 comments on commit 5bff65b

Please sign in to comment.