export const list = ( size ) => Array . from ( { length : size } , ( _ , i ) => i ) ; export const sleep = ( ms ) => new Promise ( ( r ) => setTimeout ( r , ms ) ) ; export const generator = function * ( size ) { for ( const n of list ( size ) ) { yield n ; } } ;