(array: {[key: string]: any}[], key: string)
| 44 | } |
| 45 | |
| 46 | export const arrayToObject = (array: {[key: string]: any}[], key: string) => array.reduce((p,c) => ({...p, [c[key]]: c}) , {}) |
| 47 | |
| 48 | export const renameKey = (object: {[key: string]: any}, oldKey: string, newKey: string) => { |
| 49 | if (!object) return; |