解析 URL 查询参数
(url: string)
| 32 | |
| 33 | /** 解析 URL 查询参数 */ |
| 34 | function parseQuery(url: string): Record<string, string> { |
| 35 | const idx = url.indexOf("?"); |
| 36 | if (idx < 0) return {}; |
| 37 | const params = new URLSearchParams(url.slice(idx + 1)); |
| 38 | const result: Record<string, string> = {}; |
| 39 | for (const [key, value] of params) { |
| 40 | result[key] = value; |
| 41 | } |
| 42 | return result; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * 从查询参数中提取签名字段 |
no outgoing calls
no test coverage detected
searching dependent graphs…