mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-29 03:48:26 +08:00
18f35047ec
+ add return type of splitObject + rewrite `import React from 'react'` to `import * as React from 'react'` + rewrite Checkbox in typescript
12 lines
266 B
TypeScript
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];
|
|
} |