updeep-remeda/lib/map.js

16 lines
312 B
JavaScript
Raw Normal View History

2015-08-05 07:25:34 +00:00
import mapValues from 'lodash/object/mapValues';
import update from './update';
import wrap from './wrap';
2015-08-05 07:25:34 +00:00
function map(iteratee, object) {
const updater = update(iteratee);
2015-08-05 07:25:34 +00:00
if (Array.isArray(object)) {
return object.map(updater);
}
return mapValues(object, updater);
}
export default wrap(map);