ant-design/components/_util/splitObject.tsx

12 lines
266 B
TypeScript
Raw Normal View History

export default function splitObject(obj, parts) : Array<any>{
2016-06-22 13:18:43 +08:00
let left = {};
let right = {};
Object.keys(obj).forEach((k)=> {
if (parts.indexOf(k) !== -1) {
left[k] = obj[k];
} else {
2016-06-23 10:57:52 +08:00
right[k] = obj[k];
2016-06-22 13:18:43 +08:00
}
});
return [left, right];
}