Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private buildQueryString(): string {
const parts: string[] = [];
for (let key of Object.keys(this.query || {}).sort()) {
const value = this.query[key];
key = escapeUri(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${escapeUri(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${escapeUri(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}
}
private buildQueryString(): string {
const parts: string[] = [];
for (let key of Object.keys(this.query || {}).sort()) {
const value = this.query[key];
key = escapeUri(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${escapeUri(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${escapeUri(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}
}
private buildQueryString(): string {
const parts: string[] = [];
for (let key of Object.keys(this.query || {}).sort()) {
const value = this.query[key];
key = escapeUri(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${escapeUri(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${escapeUri(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}
}
export function buildQueryString(query: QueryParameterBag): string {
const parts: string[] = [];
for (let key of Object.keys(query).sort()) {
const value = query[key];
key = escapeUri(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${escapeUri(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${escapeUri(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}
export function buildQueryString(query: QueryParameterBag): string {
const parts: string[] = [];
for (let key of Object.keys(query).sort()) {
const value = query[key];
key = escapeUri(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${escapeUri(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${escapeUri(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}
export function buildQueryString(query: QueryParameterBag): string {
const parts: string[] = [];
for (let key of Object.keys(query).sort()) {
const value = query[key];
key = escapeUri(key);
if (Array.isArray(value)) {
for (let i = 0, iLen = value.length; i < iLen; i++) {
parts.push(`${key}=${escapeUri(value[i])}`);
}
} else {
let qsEntry = key;
if (value || typeof value === "string") {
qsEntry += `=${escapeUri(value)}`;
}
parts.push(qsEntry);
}
}
return parts.join("&");
}