Skip to content

Commit

Permalink
fix: remove the trailing slash of paths in isSameURL (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElmerZhang committed Mar 2, 2020
1 parent a4a1275 commit fb63f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/utilities.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const isUnset = o => typeof o === 'undefined' || o === null
export const isSet = o => !isUnset(o)

export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]
export const isSameURL = (a, b) => a.split('?')[0].replace(/\/+$/, '') === b.split('?')[0].replace(/\/+$/, '')

export const isRelativeURL = u =>
u && u.length && /^\/([a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*)?([?][^#]*)?(#[^#]*)?$/.test(u)
Expand Down

0 comments on commit fb63f6f

Please sign in to comment.