Skip to content

Instantly share code, notes, and snippets.

@rjhilgefort
Created December 23, 2018 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjhilgefort/93ca0c9e6b51ec6b573516a1ea640d9f to your computer and use it in GitHub Desktop.
Save rjhilgefort/93ca0c9e6b51ec6b573516a1ea640d9f to your computer and use it in GitHub Desktop.
const evolveAll = spec => compose(
evolve(spec),
compose(pickAll, keys)(spec),
)
const maybeHof = compose(when, complement)(isNil)
const maybeToUpper = maybeHof(toUpper)
evolveAll({
foo: maybeToUpper,
bar: maybeToUpper,
})({
foo: 'foo',
})
// {"bar": undefined, "foo": "FOO"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment