/** * @description 重命名object的键名 * @param {Object} theObject * @param {String} objectKey * @param {String} newKey * @returns {Object} */ export const objectRenameKey = (theObject: Record, objectKey: string, newKey: string): Record => { if (Object.keys(theObject).indexOf(objectKey) !== -1) { theObject[newKey] = theObject[objectKey] delete theObject[objectKey] } return theObject }