| 1234567891011121314151617 |
- import * as _ from 'lodash'
-
- Map.prototype.toObj = function() {
- return [...this].reduce((o, [k, v]) => (o[k] = v, o), {});
- }
-
- _.updateIndex = (array, value, index) =>
- [...array.slice(0, index), value, ...array.slice(index + 1)]
-
- _.updateWhere = (array, value, predicate) => {
- const index = _.findIndex(array, predicate)
- return _.updateIndex(array, value, index)
- }
-
- _.idCheck = id => e => e.id === id
-
- export { Map, _ }
|