(searchParams: URLSearchParams)
| 557 | } |
| 558 | |
| 559 | function normalizeSearch(searchParams: URLSearchParams): string { |
| 560 | let entries = Array.from(searchParams.entries()).sort(([leftName, leftValue], [rightName, rightValue]) => { |
| 561 | if (leftName === rightName) { |
| 562 | return leftValue.localeCompare(rightValue); |
| 563 | } |
| 564 | |
| 565 | return leftName.localeCompare(rightName); |
| 566 | }); |
| 567 | let normalized = new URLSearchParams(); |
| 568 | |
| 569 | for (let [name, value] of entries) { |
| 570 | normalized.append(name, value); |
| 571 | } |
| 572 | |
| 573 | let search = normalized.toString(); |
| 574 | return search === "" ? "" : `?${search}`; |
| 575 | } |
| 576 | |
| 577 | function jsonError(error: EsmRequestError | { code: string; message: string; status: number }): Response { |
| 578 | return Response.json( |
no outgoing calls
no test coverage detected