Skip to content
Permalink
Browse files
fix(core): support querystring only url for isRelativeURL (#492)
  • Loading branch information
yangineer authored and pi0 committed Dec 26, 2019
1 parent e21de05 commit 09d81ead05c11bcd453ad59c3796987872787a12
Showing 1 changed file with 1 addition and 1 deletion.
@@ -4,7 +4,7 @@ export const isSet = o => !isUnset(o)
export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]

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

export const parseQuery = queryString => {
const query = {}

0 comments on commit 09d81ea

Please sign in to comment.