Skip to content

Commit

Permalink
if single object is passed, it will be used as array
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Feb 4, 2015
1 parent ecdd84c commit 33fcc2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion expensive-keys.js
Expand Up @@ -44,7 +44,7 @@
Object.keys(obj).forEach(function (key) {
var val = obj[key];
if (typeof val === 'number') {
result[key] = toSizeMB(val);
result[key] = toSizeMB(obj[key]);
}
});
return result;
Expand All @@ -53,6 +53,9 @@
function propertySizes(keys, items) {
if (arguments.length === 1) {
items = keys;
if (!Array.isArray(items) && typeof items === 'object') {
items = [items];
}
if (!items.length) {
return {};
}
Expand Down

0 comments on commit 33fcc2a

Please sign in to comment.