Skip to content

Instantly share code, notes, and snippets.

@JM-Mendez
Last active August 5, 2017 02:09
Show Gist options
  • Save JM-Mendez/2503ac9ea0d3b99805aa0dad62e717f1 to your computer and use it in GitHub Desktop.
Save JM-Mendez/2503ac9ea0d3b99805aa0dad62e717f1 to your computer and use it in GitHub Desktop.
const replace = func => obj => obj.replace(func)
const map = func => obj => obj.map(func)
const getProp = prop => obj => obj.get(prop)
const allStreets = compose(map(getProp('street')), getProp('addresses'))
const updateUser = user =>
allStreets(user)
.map(replace(/\d+/, '****'))
const profilePage = x => x.map(y => `<span>${y}<span>`)
const renderProfile = compose(profilePage, updateUser, getUser)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment