Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
(function(exports) {
|
||||
|
||||
exports = exports || {};
|
||||
|
||||
var mozContactUtils = {
|
||||
// Checks if an object fields are empty, by empty means
|
||||
// field is null and if it's an array it's length is 0
|
||||
haveEmptyFields: function (obj, fields) {
|
||||
if (obj === null ||
|
||||
typeof(obj) != 'object' ||
|
||||
!fields || !fields.length) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var attr;
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
attr = fields[i];
|
||||
if (obj[attr]) {
|
||||
if (Array.isArray(obj[attr])) {
|
||||
if (obj[attr].length > 0) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
exports.mozContact = mozContactUtils;
|
||||
|
||||
})(window.utils);
|
||||
Loading…
Reference in a new issue