1 | /**
|
2 | * Merges the provided objects shallowly and removes
|
3 | * all properties with an `undefined` value
|
4 | */
|
5 | export function compact() {
|
6 | var objects = [];
|
7 | for (var _i = 0; _i < arguments.length; _i++) {
|
8 | objects[_i] = arguments[_i];
|
9 | }
|
10 | var result = Object.create(null);
|
11 | objects.forEach(function (obj) {
|
12 | if (!obj)
|
13 | return;
|
14 | Object.keys(obj).forEach(function (key) {
|
15 | var value = obj[key];
|
16 | if (value !== void 0) {
|
17 | result[key] = value;
|
18 | }
|
19 | });
|
20 | });
|
21 | return result;
|
22 | }
|
23 | //# sourceMappingURL=compact.js.map |
\ | No newline at end of file |