UNPKG
@axoncodes/xjs
Version:
latest (1.1.0)
1.1.0
1.0.2
1.0.1
0.0.1
Better quality time with JS
@axoncodes/xjs
/
lib
/
xmapIf.js
8 lines
(6 loc)
•
204 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const
xif =
require
(
'./xif'
)
const
xmap =
require
(
'./xmap'
)
function
xmapIf
(
arr, condition, root=
false
) {
return
xmap
(arr,
input
=>
xif
(input, condition,
true
, root)) }
module
.
exports
= xmapIf;