1 | import { obj } from '../util';
|
2 |
|
3 | var isPlainObject = obj.isPlainObject;
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export function filterUndefinedValue(object) {
|
12 | if (!isPlainObject(object)) {
|
13 | return object;
|
14 | }
|
15 |
|
16 | var obj = {};
|
17 |
|
18 | Object.keys(object).forEach(function (key) {
|
19 | var value = object[key];
|
20 |
|
21 | if (value !== undefined) {
|
22 | obj[key] = value;
|
23 | }
|
24 | });
|
25 |
|
26 | return obj;
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export function stripObject(obj, subObj) {
|
36 | var newObject = {};
|
37 |
|
38 | Object.keys(obj).forEach(function (key) {
|
39 | if (!(key in subObj)) {
|
40 | newObject[key] = obj[key];
|
41 | }
|
42 | });
|
43 | return newObject;
|
44 | } |
\ | No newline at end of file |