We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
isSameURL
1 parent a4a1275 commit fb63f6fCopy full SHA for fb63f6f
lib/core/utilities.js
@@ -1,7 +1,7 @@
1
export const isUnset = o => typeof o === 'undefined' || o === null
2
export const isSet = o => !isUnset(o)
3
4
-export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]
+export const isSameURL = (a, b) => a.split('?')[0].replace(/\/+$/, '') === b.split('?')[0].replace(/\/+$/, '')
5
6
export const isRelativeURL = u =>
7
u && u.length && /^\/([a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*)?([?][^#]*)?(#[^#]*)?$/.test(u)
0 commit comments