-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
117 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import { stringify } from "./safeJson" | ||
import { IHeader, INetworkRequest } from "@/helpers/networkHelpers" | ||
import { stringify } from './safeJson' | ||
import { IHeader, ICompleteNetworkRequest } from '@/helpers/networkHelpers' | ||
|
||
const stringifyHeaders = (headers: IHeader[] = []) => { | ||
return headers | ||
.map((header) => { | ||
return `${header.name}: ${header.value}` | ||
}) | ||
.join(", ") | ||
.join(', ') | ||
} | ||
|
||
export const getHeaderSearchContent = ( | ||
networkRequest: INetworkRequest | ||
networkRequest: ICompleteNetworkRequest | ||
): string => { | ||
const requestHeaderText = stringifyHeaders(networkRequest.request.headers) | ||
const responseHeaderText = stringifyHeaders(networkRequest.response?.headers) | ||
return [requestHeaderText, responseHeaderText].join(", ") | ||
return [requestHeaderText, responseHeaderText].join(', ') | ||
} | ||
|
||
export const getRequestSearchContent = ( | ||
networkRequest: INetworkRequest | ||
networkRequest: ICompleteNetworkRequest | ||
): string => { | ||
return networkRequest.request.body | ||
.map((body) => { | ||
return body.query + " " + stringify(body.variables) | ||
return body.query + ' ' + stringify(body.variables) | ||
}) | ||
.join(", ") | ||
.join(', ') | ||
} | ||
|
||
export const getResponseSearchContent = ( | ||
networkRequest: INetworkRequest | ||
networkRequest: ICompleteNetworkRequest | ||
): string => { | ||
return networkRequest.response?.body || "" | ||
return networkRequest.response?.body || '' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.