Skip to content

Commit

Permalink
Fix octokit types
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Feb 18, 2025
1 parent dee6931 commit 1cc0940
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export async function downloadTelemetryTemplate({ githubToken }: { githubToken:
},
});

if (Array.isArray(file.data)) {
if (!Array.isArray(file.data) && file.data.type === 'file') {
return JSON.parse(Buffer.from(file.data.content!, 'base64').toString()) as {
index_patterns: string[];
mappings: {
properties: Record<string, any>;
};
settings: Record<string, any>;
};
} else {
throw new Error('Expected single response, got array');
}

return JSON.parse(Buffer.from(file.data.content!, 'base64').toString()) as {
index_patterns: string[];
mappings: {
properties: Record<string, any>;
};
settings: Record<string, any>;
};
}

0 comments on commit 1cc0940

Please sign in to comment.