(obj?: Record<string, unknown>)
| 45 | } |
| 46 | |
| 47 | export function stringify (obj?: Record<string, unknown>) { |
| 48 | if (obj == null) { |
| 49 | return '' |
| 50 | } |
| 51 | const path = Object.keys(obj).map((key) => { |
| 52 | return key + '=' + obj[key] |
| 53 | }).join('&') |
| 54 | return path === '' ? path : '?' + path |
| 55 | } |
| 56 | |
| 57 | export function getPath (id: string, options?: Record<string, unknown>): string { |
| 58 | const idx = id.indexOf('?') |