UNPKG
monk-import-export
Version:
latest (0.0.0)
0.0.0
Simple import & export sorting ESLint plugin
monk-import-export
/
build
/
utils
/
flatMap.js
9 lines
(8 loc)
•
306 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
flatMap
=
void
0
;
// Like `Array.prototype.flatMap`, had it been available.
function
flatMap
(
array, callback
) {
return
array.
reduce
(
(
result, value
) =>
result.
concat
(
callback
(value)), []); }
exports
.
flatMap
= flatMap;