Skip to content

Commit

Permalink
refactor(renameKeysWith): use lenses instead of adjust
Browse files Browse the repository at this point in the history
Ref #745
  • Loading branch information
char0n committed Nov 25, 2018
1 parent c80fd5d commit 43839f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renameKeysWith.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { curry, toPairs, pipe, map, adjust, fromPairs } from 'ramda';
import { curry, toPairs, pipe, map, over, lensIndex, fromPairs } from 'ramda';

/**
* Creates a new object with the own properties of the provided object, but the
Expand All @@ -23,7 +23,7 @@ import { curry, toPairs, pipe, map, adjust, fromPairs } from 'ramda';
const renameKeysWith = curry((fn, obj) =>
pipe(
toPairs,
map(adjust(fn, 0)),
map(over(lensIndex(0), fn)),
fromPairs
)(obj)
);
Expand Down

0 comments on commit 43839f3

Please sign in to comment.