Last active
August 5, 2017 02:09
-
-
Save JM-Mendez/2503ac9ea0d3b99805aa0dad62e717f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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