updeep-remeda/lib/index.js

27 lines
586 B
JavaScript
Raw Normal View History

2015-08-05 07:25:34 +00:00
import freeze from './freeze';
2015-08-05 06:36:40 +00:00
import _in from './in';
import _if from './if';
2015-08-05 07:25:34 +00:00
import map from './map';
2015-08-01 15:13:25 +00:00
import omit from './omit';
import reject from './reject';
import withDefault from './withDefault';
2015-08-05 07:25:34 +00:00
import update from './update';
2015-08-02 07:32:32 +00:00
import curry from 'lodash/function/curry';
2015-08-05 07:27:56 +00:00
function updateAndFreeze(updates, object) {
return freeze(update(updates, object));
2015-08-02 07:32:32 +00:00
}
2015-08-01 15:13:25 +00:00
2015-08-05 04:56:01 +00:00
const updeep = curry(updateAndFreeze);
2015-08-02 07:32:32 +00:00
2015-08-05 06:36:40 +00:00
updeep.if = _if;
updeep.in = _in;
2015-08-05 05:34:02 +00:00
updeep.freeze = freeze;
2015-08-05 07:25:34 +00:00
updeep.map = map;
2015-08-05 04:56:01 +00:00
updeep.omit = omit;
updeep.reject = reject;
updeep.withDefault = withDefault;
2015-08-02 07:32:32 +00:00
2015-08-05 04:56:01 +00:00
export default updeep;