Skip to content

Commit 219b6dd

Browse files
committed
Minor fixes
1 parent d694734 commit 219b6dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class Api {
2424
params?: Array<Pair<string, string>>,
2525
headers?: Array<Pair<string, string>>,
2626
body?: string
27-
) {
27+
): Promise<any> {
2828
const paramsData: Record<string, string> = {};
2929
// In order to allow for duplicate URL params add a suffix to it to
3030
// uniquify the key. We strip this suffix off as part of
@@ -49,7 +49,7 @@ export default class Api {
4949
/**
5050
* Used as a health check.
5151
*/
52-
async test() {
52+
async test(): Promise<any> {
5353
const data: Record<string, string> = {};
5454

5555
this.params.forEach((value, key) => {
@@ -69,7 +69,7 @@ export default class Api {
6969
params: Array<Pair<string, string>>,
7070
headers?: Array<Pair<string, string>>,
7171
body?: string
72-
) {
72+
): Promise<any> {
7373
if (!cacheDurationSeconds) {
7474
return await this.get(method, path, params, headers, body);
7575
}

src/datasource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class JsonDataSource extends DataSourceApi<JsonApiQuery, JsonApiDataSourc
129129
throw new Error('Query returned empty data');
130130
}
131131

132-
const fields: Field[] = query.fields
132+
const fields: Field[] = (query.fields ?? [])
133133
.filter((field) => field.jsonPath)
134134
.map((field, index) => {
135135
switch (field.language) {

0 commit comments

Comments
 (0)