mirror of
https://github.com/SethCohen/github-releases-to-discord
synced 2026-09-14 20:13:23 +00:00
chore: added updated dependencies
This commit is contained in:
+8
-8
@@ -13,15 +13,15 @@
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
|
||||
Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev)
|
||||
Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [esm.sh](https://esm.sh)
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
|
||||
import { Octokit } from "https://esm.sh/@octokit/core";
|
||||
import {
|
||||
paginateRest,
|
||||
composePaginateRest,
|
||||
} from "https://cdn.skypack.dev/@octokit/plugin-paginate-rest";
|
||||
} from "https://esm.sh/@octokit/plugin-paginate-rest";
|
||||
</script>
|
||||
```
|
||||
|
||||
@@ -90,7 +90,7 @@ const issueTitles = await octokit.paginate(
|
||||
since: "2010-10-01",
|
||||
per_page: 100,
|
||||
},
|
||||
(response) => response.data.map((issue) => issue.title)
|
||||
(response) => response.data.map((issue) => issue.title),
|
||||
);
|
||||
```
|
||||
|
||||
@@ -110,7 +110,7 @@ const issues = await octokit.paginate(
|
||||
done();
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
},
|
||||
);
|
||||
```
|
||||
|
||||
@@ -138,7 +138,7 @@ const parameters = {
|
||||
};
|
||||
for await (const response of octokit.paginate.iterator(
|
||||
"GET /repos/{owner}/{repo}/issues",
|
||||
parameters
|
||||
parameters,
|
||||
)) {
|
||||
// do whatever you want with each response, break out of the loop, etc.
|
||||
const issues = response.data;
|
||||
@@ -157,7 +157,7 @@ const parameters = {
|
||||
};
|
||||
for await (const response of octokit.paginate.iterator(
|
||||
octokit.rest.issues.listForRepo,
|
||||
parameters
|
||||
parameters,
|
||||
)) {
|
||||
// do whatever you want with each response, break out of the loop, etc.
|
||||
const issues = response.data;
|
||||
@@ -235,7 +235,7 @@ type DataType<T> = "data" extends keyof T ? T["data"] : unknown;
|
||||
async function myPaginatePlugin<E extends keyof PaginatingEndpoints>(
|
||||
octokit: Octokit,
|
||||
endpoint: E,
|
||||
parameters?: PaginatingEndpoints[E]["parameters"]
|
||||
parameters?: PaginatingEndpoints[E]["parameters"],
|
||||
): Promise<DataType<PaginatingEndpoints[E]["response"]>> {
|
||||
return await composePaginateRest(octokit, endpoint, parameters);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user