Files
Odoo-GraphQL-Subscription-C…/graphql-subscription/node_modules/@apollo/client/utilities/common/compact.js
2024-06-03 20:23:50 +05:30

23 lines
610 B
JavaScript

/**
* Merges the provided objects shallowly and removes
* all properties with an `undefined` value
*/
export function compact() {
var objects = [];
for (var _i = 0; _i < arguments.length; _i++) {
objects[_i] = arguments[_i];
}
var result = Object.create(null);
objects.forEach(function (obj) {
if (!obj)
return;
Object.keys(obj).forEach(function (key) {
var value = obj[key];
if (value !== void 0) {
result[key] = value;
}
});
});
return result;
}
//# sourceMappingURL=compact.js.map