UNPKG

monk-import-export

Version:

Simple import & export sorting ESLint plugin

5 lines (4 loc) 218 B
// Like `Array.prototype.flatMap`, had it been available. export function flatMap<T>(array: T[], callback: (value: T) => T[]): T[] { return array.reduce((result: T[], value) => result.concat(callback(value)), []); }