Skip to content

Commit be01137

Browse files
committed
added new methods
1 parent 66258a6 commit be01137

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

dist/breinify-api.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12697,6 +12697,27 @@ dependencyScope.jQuery = $;;
1269712697
return new Date().toString();
1269812698
},
1269912699

12700+
deleteNullProperties: function (input) {
12701+
if (!$.isPlainObject(input)) {
12702+
return input;
12703+
}
12704+
12705+
for (var property in input) {
12706+
if (input.hasOwnProperty(property)) {
12707+
if (input[property] === null) {
12708+
delete input[property];
12709+
} else if ($.isPlainObject(input[property])) {
12710+
this.deleteNullProperties(input[property]);
12711+
if ($.isEmptyObject(input[property])) {
12712+
delete input[property];
12713+
}
12714+
} else {
12715+
// nothing to do
12716+
}
12717+
}
12718+
}
12719+
},
12720+
1270012721
getNested: function (obj /*, level1, level2, ... levelN*/) {
1270112722
if (!$.isPlainObject(obj) || obj === null) {
1270212723
return null;
@@ -14121,6 +14142,7 @@ dependencyScope.jQuery = $;;
1412114142
localDateTime: function() { return new Date().toString(); },
1412214143
uuid: function() { return null; },
1412314144
getNested: function() { return null; },
14145+
deleteNullProperties: function(data) { return data; },
1412414146
endsWith: function() { return false; },
1412514147
_jquery: function() { return null; }
1412614148
};

0 commit comments

Comments
 (0)