export const flatMap = (arr: T[], fn: (item: T) => K[]) => arr.reduce((acc, item) => acc.concat(fn(item)), []) export default flatMap