MCPcopy
hub / github.com/Kong/insomnia / buildQueryStringFromParams

Function buildQueryStringFromParams

packages/insomnia/src/utils/url/querystring.ts:92–107  ·  view source on GitHub ↗
(
  parameters: { name: string; value?: string }[],
  /** allow empty names and values */
  strict?: boolean,
)

Source from the content-addressed store, hash-verified

90 * Build a querystring from a list of name/value pairs
91 */
92export const buildQueryStringFromParams = (
93 parameters: { name: string; value?: string }[],
94 /** allow empty names and values */
95 strict?: boolean,
96) => {
97 strict = strict === undefined ? true : strict;
98 const items = [];
99 for (const param of parameters) {
100 const built = buildQueryParameter(param, strict);
101 if (!built) {
102 continue;
103 }
104 items.push(built);
105 }
106 return items.join('&');
107};
108
109/**
110 * Deconstruct a querystring to name/value pairs

Callers 9

transformUrlFunction · 0.90
openWebSocketConnectionFunction · 0.90
startListeningFunction · 0.90
RenderedQueryStringFunction · 0.90
interpolateOpenAndSendFunction · 0.90
handleSubmitFunction · 0.90
runFunction · 0.90
smartEncodeUrlFunction · 0.85

Calls 2

buildQueryParameterFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected