ant-design/components/_util/splitObject.tsx
2016-06-23 10:57:52 +08:00

12 lines
254 B
TypeScript

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[k] = obj[k];
}
});
return [left, right];
}