Skip to content

Instantly share code, notes, and snippets.

@Shuumatsu
Created September 21, 2017 07:57
Show Gist options
  • Save Shuumatsu/9e7457ff1f8102c756b9569b7d03f774 to your computer and use it in GitHub Desktop.
Save Shuumatsu/9e7457ff1f8102c756b9569b7d03f774 to your computer and use it in GitHub Desktop.
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