From d7659c8a5dfc17a191ed1ab30e3444be181a61c9 Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Thu, 10 Mar 2022 16:04:13 +0100 Subject: [PATCH] fix(types): created 'Groups' type --- src/index.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 44a352b7..99e4d917 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { ThrottlingOptionsBase, AbuseLimitHandler, SecondaryLimitHandler, + Groups, } from "./types"; import { VERSION } from "./version"; @@ -18,31 +19,27 @@ import { routeMatcher } from "./route-matcher"; const regex = routeMatcher(triggersNotificationPaths); const triggersNotification = regex.test.bind(regex); -const groups = {}; +const groups: Groups = {}; // @ts-expect-error const createGroups = function (Bottleneck, common) { - // @ts-expect-error groups.global = new Bottleneck.Group({ id: "octokit-global", maxConcurrent: 10, ...common, }); - // @ts-expect-error groups.search = new Bottleneck.Group({ id: "octokit-search", maxConcurrent: 1, minTime: 2000, ...common, }); - // @ts-expect-error groups.write = new Bottleneck.Group({ id: "octokit-write", maxConcurrent: 1, minTime: 1000, ...common, }); - // @ts-expect-error groups.notifications = new Bottleneck.Group({ id: "octokit-notifications", maxConcurrent: 1, @@ -72,7 +69,6 @@ export function throttling(octokit: Octokit, octokitOptions: OctokitOptions) { } const common = { connection, timeout }; - // @ts-expect-error if (groups.global == null) { createGroups(Bottleneck, common); }