Function: normalizeRedirect()
ts
function normalizeRedirect(redirect): string;规范化 redirect 路径:去掉 hash,合并开头多余的 /。
Parameters
| Parameter | Type |
|---|---|
redirect | string |
Returns
string
Example
ts
normalizeRedirect('/page#section') // => /page
normalizeRedirect('///user') // => /user
normalizeRedirect('/page?foo=1') // => /page?foo=1
normalizeRedirect('') // => /