(url: string, isCompleteUrl = true)
| 355 | } |
| 356 | } |
| 357 | const parseUrl2QueryParams = (url: string, isCompleteUrl = true) => { |
| 358 | const index = url.indexOf('?') |
| 359 | if (index === -1 && isCompleteUrl) { |
| 360 | return {} |
| 361 | } |
| 362 | const queryStr = url.substring(index + 1) |
| 363 | const queryParamsArr = queryStr.split('&') |
| 364 | const res: { [key: string]: string } = {} |
| 365 | for (const item of queryParamsArr) { |
| 366 | const [key, value] = item.split('=') |
| 367 | res[key] = value |
| 368 | } |
| 369 | return res |
| 370 | } |
| 371 | // https://github.com/jimmycuadra/shellwords/blob/main/src/shellwords.ts |
| 372 | const scan = (string: string, pattern: RegExp, callback: (match: RegExpMatchArray) => void) => { |
| 373 | let result = '' |
no outgoing calls
no test coverage detected