You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
251 B
12 lines
251 B
9 years ago
|
export default function splitObject(obj, parts) {
|
||
|
let left = {};
|
||
|
let right = {};
|
||
|
Object.keys(obj).forEach((k)=> {
|
||
|
if (parts.indexOf(k) !== -1) {
|
||
|
left[k] = obj[k];
|
||
|
} else {
|
||
|
right = obj[k];
|
||
|
}
|
||
|
});
|
||
|
return [left, right];
|
||
|
}
|