Skip to content

Commit

Permalink
fix(core): support querystring only url for isRelativeURL (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangineer authored and pi0 committed Dec 26, 2019
1 parent e21de05 commit 09d81ea
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
Expand Up @@ -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 = {}
Expand Down

0 comments on commit 09d81ea

Please sign in to comment.