You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design/components/_util/splitObject.tsx

13 lines
272 B
TypeScript

export default function splitObject(obj, parts): Array<any> {
const left = {};
const right = {};
Object.keys(obj).forEach((k) => {
if (parts.indexOf(k) !== -1) {
left[k] = obj[k];
} else {
right[k] = obj[k];
}
});
return [left, right];
}