export const toBase64 = ( string ) => Buffer . from ( string ) . toString ( 'base64' ) ; export const fromBase64 = ( base64String ) => Buffer . from ( base64String , 'base64' ) . toString ( ) ; export const getLastOfArray = < T > ( array ) => { if ( array . length ) { const { length , [ length - 1 ] : last } = array ; return last ; } return null ; } ;