(mockDispatches, key)
| 10981 | if (typeof mockDispatch2.headers === "undefined") { |
| 10982 | return true; |
| 10983 | } |
| 10984 | if (typeof headers !== "object" || typeof mockDispatch2.headers !== "object") { |
| 10985 | return false; |
| 10986 | } |
| 10987 | for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) { |
| 10988 | const headerValue = getHeaderByName(headers, matchHeaderName); |
| 10989 | if (!matchValue(matchHeaderValue, headerValue)) { |
| 10990 | return false; |
| 10991 | } |
| 10992 | } |
| 10993 | return true; |
| 10994 | } |
| 10995 | function safeUrl(path4) { |
| 10996 | if (typeof path4 !== "string") { |
| 10997 | return path4; |
| 10998 | } |
| 10999 | const pathSegments = path4.split("?"); |
| 11000 | if (pathSegments.length !== 2) { |
| 11001 | return path4; |
| 11002 | } |
| 11003 | const qp = new URLSearchParams(pathSegments.pop()); |
| 11004 | qp.sort(); |
| 11005 | return [...pathSegments, qp.toString()].join("?"); |
| 11006 | } |
| 11007 | function matchKey(mockDispatch2, { path: path4, method, body, headers }) { |
no test coverage detected