param n private export const _randomGenerator = ( n ) : string => Math . random ( ) . toString ( 26 ) . slice ( 2 ) . substring ( 0 , n ) ; param length param list export const randomString = ( length , list = [ ] ) : string => { let str = _randomGenerator ( length ) ; while ( list . includes ( str ) ) { str = _randomGenerator ( length ) ; } return str ; } ; export default randomString ;