first commit
This commit is contained in:
commit
db5762abd4
687 files changed
+171307
No files matched your search
@@ -0,0 +1,29 @@
|
||||
function e(e) {
|
||||
if (
|
||||
typeof e != `string` ||
|
||||
!e.startsWith(`/`) ||
|
||||
e.startsWith(`//`) ||
|
||||
/[\\\u0000-\u0020\u007f]/.test(e)
|
||||
)
|
||||
return `/`;
|
||||
try {
|
||||
let t = decodeURIComponent(e.split(/[?#]/, 1)[0] || ``);
|
||||
if (t.startsWith(`//`) || /[\\\u0000-\u0020\u007f]/.test(t)) return `/`;
|
||||
} catch {
|
||||
return `/`;
|
||||
}
|
||||
return e;
|
||||
}
|
||||
function t(t) {
|
||||
let n = e(t);
|
||||
return n === `/`
|
||||
? {}
|
||||
: {
|
||||
redirect: n,
|
||||
};
|
||||
}
|
||||
function n(t, n) {
|
||||
let r = e(n);
|
||||
return r === `/` ? t : `${t}?redirect=${encodeURIComponent(r)}`;
|
||||
}
|
||||
export { t as n, e as r, n as t };
|
||||
Reference in new issue
Block a user