(result: Array<object>)
| 15 | const wantedInfoKeys = ['type', 'name', 'description', 'category', 'tags']; |
| 16 | |
| 17 | function formatResult(result: Array<object>): Array<any> { |
| 18 | const formattedResult = result.map(result => { |
| 19 | const tmp = pick(result, wantedInfoKeys); |
| 20 | set(tmp, 'category', get(tmp, 'category.name')); |
| 21 | return tmp; |
| 22 | }); |
| 23 | |
| 24 | return formattedResult; |
| 25 | } |
| 26 | |
| 27 | export default (program: Command) => { |
| 28 | program |