From 1c1df88f8936b456c8c00691f9392fd1b913f51f Mon Sep 17 00:00:00 2001 From: Gregor Martynus Date: Tue, 24 Mar 2020 14:09:28 -0700 Subject: [PATCH] fix: update `Octokit.plugin()` API to remove deprecation fixes #1654 --- src/index.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 11ac8e49..4c40b0da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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}` });