updeep-remeda/lib/map.js

16 lines
312 B
JavaScript

import mapValues from 'lodash/object/mapValues';
import update from './update';
import wrap from './wrap';
function map(iteratee, object) {
const updater = update(iteratee);
if (Array.isArray(object)) {
return object.map(updater);
}
return mapValues(object, updater);
}
export default wrap(map);