(obj, c = '&', encodeUrl = false)
| 75 | return "undefined" != typeof module && !!module.exports; |
| 76 | } |
| 77 | jsonToStr(obj, c = '&', encodeUrl = false) { |
| 78 | let ret = [] |
| 79 | for (let keys of Object.keys(obj).sort()) { |
| 80 | let v = obj[keys] |
| 81 | if (v && encodeUrl) v = encodeURIComponent(v) |
| 82 | ret.push(keys + '=' + v) |
| 83 | } |
| 84 | return ret.join(c); |
| 85 | } |
| 86 | getURLParams(url) { |
| 87 | try { return Object.fromEntries(new URL(url, "http://localhost").searchParams) } catch { return {} } |
| 88 | } |
no outgoing calls
no test coverage detected