Skip to content

Instantly share code, notes, and snippets.

@hacker-DOM
Last active June 18, 2019 13:02
Show Gist options
  • Save hacker-DOM/b9db9798ed18198d95325fbdb4f9efbb to your computer and use it in GitHub Desktop.
Save hacker-DOM/b9db9798ed18198d95325fbdb4f9efbb to your computer and use it in GitHub Desktop.
const reshape = R.curry((shape, object) =>
R.mapObjIndexed(
fn => R.is(Array, fn) ? R.pipe(...fn)(object) : fn(object),
shape
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment