Skip to content

Commit 33fcc2a

Browse files
committed
if single object is passed, it will be used as array
1 parent ecdd84c commit 33fcc2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

expensive-keys.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
Object.keys(obj).forEach(function (key) {
4545
var val = obj[key];
4646
if (typeof val === 'number') {
47-
result[key] = toSizeMB(val);
47+
result[key] = toSizeMB(obj[key]);
4848
}
4949
});
5050
return result;
@@ -53,6 +53,9 @@
5353
function propertySizes(keys, items) {
5454
if (arguments.length === 1) {
5555
items = keys;
56+
if (!Array.isArray(items) && typeof items === 'object') {
57+
items = [items];
58+
}
5659
if (!items.length) {
5760
return {};
5861
}

0 commit comments

Comments
 (0)