Skip to content

Commit 8d15b04

Browse files
committed
fix: satisfy lint for query-string update
1 parent c8e2eaf commit 8d15b04

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

src/api/query/utils.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ export function syntaxToRel(syntax: CsvConfigSyntax) {
8181
const prop = k as keyof CsvConfigSyntax;
8282

8383
if (prop === 'header') {
84-
const headerStr = Object.keys(syntax.header!)
85-
.map(key => {
86-
return `(${key}, :${toRelLiteral(syntax.header![key])})`;
87-
})
88-
.join('; ');
89-
qs.push(`def config[:syntax, :header]: { ${headerStr} }`);
84+
const header = syntax.header;
85+
86+
if (header) {
87+
const headerStr = Object.keys(header)
88+
.map(key => {
89+
return `(${key}, :${toRelLiteral(header[key])})`;
90+
})
91+
.join('; ');
92+
qs.push(`def config[:syntax, :header]: { ${headerStr} }`);
93+
}
9094
} else {
9195
qs.push(`def config[:syntax, :${prop}]: ${toRelLiteral(syntax[prop])}`);
9296
}

src/rest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ export async function request<T>(url: string, options: RequestOptions = {}) {
8787

8888
const fullUrl =
8989
options.query && Object.keys(options.query).length > 0
90-
? `${url}?${queryString.stringify(options.query, { arrayFormat: 'none' })}`
90+
? `${url}?${queryString.stringify(options.query, {
91+
arrayFormat: 'none',
92+
})}`
9193
: url;
9294

9395
let response;

0 commit comments

Comments
 (0)