import { ImportKey } from './interface' ; export const updateKey = ( oldKeys , id , newKey ) : ImportKey [ ] => { return oldKeys . map ( ( oldKey ) => { if ( oldKey . id !== id ) { return oldKey ; } return { ... oldKey , ... newKey } ; } ) ; } ;