Skip to content

Commit fb63f6f

Browse files
authored
fix: remove the trailing slash of paths in isSameURL (#542)
1 parent a4a1275 commit fb63f6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const isUnset = o => typeof o === 'undefined' || o === null
22
export const isSet = o => !isUnset(o)
33

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

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

0 commit comments

Comments
 (0)