Skip to content

Commit 6faaeb6

Browse files
Move isEmpty to utils
1 parent 80a591e commit 6faaeb6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

extensions/web-base/www/app/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function apply(to, fn) {
1919
};
2020
}
2121

22+
function isEmpty(obj) {
23+
return ((obj === null) || (obj === undefined)) || (Array.isArray(obj) && (obj.length === 0)) || (Object.keys(obj).length === 0);
24+
}
25+
2226
function swapMap(m) {
2327
var r = {};
2428
for (var k in m) {

extensions/web-dashboard/web-dashboard.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ define(['./web-dashboard.xml'], function(dashboardTemplate) {
5151
return unitAlias[unit] || unit || '';
5252
}
5353

54-
function isEmpty(obj) {
55-
return ((obj === null) || (obj === undefined)) || (Array.isArray(obj) && (obj.length === 0)) || (Object.keys(obj).length === 0);
56-
}
57-
5854
function formatValue(value, type) {
5955
// format the value to 6 characters max
6056
var valueType = typeof value;

0 commit comments

Comments
 (0)