Created
September 21, 2017 07:57
-
-
Save Shuumatsu/9e7457ff1f8102c756b9569b7d03f774 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { | |
compose, map, ifElse, filter, isEmpty, | |
endsWith, init, identity, join | |
} from 'ramda' | |
const urljoin = compose( | |
join('/'), | |
map(ifElse(endsWith('/'), init, identity)), | |
filter(isEmpty) | |
) | |
export default urljoin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment