(
parameters: { name: string; value?: string }[],
/** allow empty names and values */
strict?: boolean,
)
| 90 | * Build a querystring from a list of name/value pairs |
| 91 | */ |
| 92 | export 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 |
no test coverage detected