(source: Source)
| 36 | } |
| 37 | |
| 38 | static from(source: Source): SearchQuery { |
| 39 | if (source instanceof Location || source instanceof HTMLAnchorElement) { |
| 40 | return new SearchQuery(source.href); |
| 41 | } |
| 42 | |
| 43 | const url = new URL('https://github.com'); |
| 44 | for (const [name, value] of Object.entries(source)) { |
| 45 | url.searchParams.set(name, value); |
| 46 | } |
| 47 | |
| 48 | return new SearchQuery(url); |
| 49 | } |
| 50 | |
| 51 | private readonly url: URL; |
| 52 | private queryParts: string[]; |
no test coverage detected