UNPKG
imma
Version:
latest (0.0.1)
0.0.1
A collection of functions for dealing with native arrays and objects immutably
imma
/
lib
/
general
/
mergeWith.js
9 lines
(7 loc)
•
290 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
'use strict'
const
arrayMergeWith =
require
(
'../array/mergeWith'
)
const
objectMergeWith =
require
(
'../object/mergeWith'
)
const
mergeWith =
module
.
exports
=
(
fn, ...iterables
) =>
Array
.
isArray
(iterables[
0
]) ?
arrayMergeWith
(iterables, fn) :
objectMergeWith
(iterables, fn)