Skip to content

Commit

Permalink
fix: update Octokit.plugin() API to remove deprecation
Browse files Browse the repository at this point in the history
fixes #1654
  • Loading branch information
gr2m committed Mar 24, 2020
1 parent ee4a65a commit 1c1df88
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";

import { VERSION } from "./version";

export const Octokit = Core.plugin([
// Workaround to prevent TypeScript from widening the inferred return type of
// plugins passed to Octokit, which would result in type information (e.g.
// methods provided by plugins) not being added to Octokit instances.
//
// See https://github.com/octokit/core.js/issues/51#issuecomment-596846088
(requestLog as unknown) as () => void,
export const Octokit = Core.plugin(
requestLog,
restEndpointMethods,
paginateRest
]).defaults({
).defaults({
userAgent: `octokit-rest.js/${VERSION}`
});

Expand Down

0 comments on commit 1c1df88

Please sign in to comment.