ant-design/components/_util/splitObject.tsx
RaoHai 18f35047ec Rewrite Checkbox in typescript
+ add return type of splitObject
 + rewrite `import React from 'react'` to `import * as React from 'react'`
 + rewrite Checkbox in typescript
2016-06-30 10:05:29 +08:00

12 lines
266 B
TypeScript

export default function splitObject(obj, parts) : Array<any>{
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];
}