- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
exports.removeResponseFields = function(params, callback) {
_.each(params.data, function(obj, index) {
for (var k in obj) {
if (obj[k] instanceof Array) {
_.each(obj[k], function(innerObj, innerindex) {
for (var pk in innerObj) {
if (params.showNull) return innerObj[pk] = innerObj[pk] === null ? '' : innerObj[pk];
if (innerObj[pk] === null) delete innerObj[pk];
}
});
}
if (params.showNull) return obj[k] === null ? '' : obj[k];
if (obj[k] === null) delete obj[k];
}
});
callback(params.data);
};