Skip to content

Commit cbc9b94

Browse files
committed
Use named option parameters for withGithubSdks()
1 parent d2b5693 commit cbc9b94

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

examples/docusaurus/speakeasy.glean.config.github.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { withGithubSdks } from "@speakeasy-api/docs-md";
22

3-
const sdkConfigs = await withGithubSdks(
4-
[
3+
const sdkConfigs = await withGithubSdks({
4+
sdks: [
55
{
66
language: "typescript",
77
owner: "gleanwork",
@@ -16,8 +16,8 @@ const sdkConfigs = await withGithubSdks(
1616
language: "curl",
1717
},
1818
],
19-
process.env.GITHUB_TOKEN
20-
);
19+
token: process.env.GITHUB_TOKEN,
20+
});
2121

2222
export default {
2323
spec: "../specs/glean.yaml",

packages/compiler/src/fetchers/withGithub.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ type GithubSdkConfig = {
1717
version: string;
1818
} & CodeSample;
1919

20-
export async function withGithubSdks(
21-
sdks: GithubSdkConfig[],
22-
token: string
23-
): Promise<Pick<Settings, "codeSamples">> {
20+
export async function withGithubSdks({
21+
sdks,
22+
token,
23+
}: {
24+
sdks: GithubSdkConfig[];
25+
token: string;
26+
}): Promise<Pick<Settings, "codeSamples">> {
2427
const octokit = new Octokit({
2528
auth: token,
2629
});

0 commit comments

Comments
 (0)