import { random } from './random' export function sample(list: T[] = []) { const len = list.length return len ? list[random(len - 1)] : undefined }