New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add util function to ensure a trailing / on publicUrl #197

Merged
merged 4 commits into from Aug 14, 2018

Conversation

Projects
None yet
3 participants
@Huanzhang89
Copy link
Contributor

Huanzhang89 commented Aug 14, 2018

No description provided.

export { prefixUrl }
// trailing slash helper
export const ensureSlash = path => {
return path.endsWith('/') ? `${path}/` : path

This comment has been minimized.

@bpierre

bpierre Aug 14, 2018

Member

Shouldn’t it be the other way?

This comment has been minimized.

@Huanzhang89

Huanzhang89 Aug 14, 2018

Contributor

oh wow mistakes were made

export { prefixUrl }
// trailing slash helper
export const ensureSlash = path => {
return path.endsWith('/') ? `${path}/` : path

This comment has been minimized.

@bpierre

bpierre Aug 14, 2018

Member

I wonder if we could name it something like ensureFinalSlash, ensureTrailingSlash or just trailingSlash, to make it clear that it is added at the end of the string?

This comment has been minimized.

@Huanzhang89

Huanzhang89 Aug 14, 2018

Contributor

Yeah agreed, will update the name

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Aug 14, 2018

CLA assistant check
All committers have signed the CLA.

@bpierre
Copy link
Member

bpierre left a comment

Awesome, thanks!

@bpierre bpierre merged commit b8da2b2 into aragon:master Aug 14, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment