Skip to content

Commit 8970302

Browse files
committed
fix: deprecated endpoint methods have .endpoint() method, too
1 parent 25b94dd commit 8970302

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/register-endpoints.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ export function registerEndpoints(octokit: any, routes: any) {
5151
}
5252

5353
if (apiOptions.deprecated) {
54-
octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
55-
octokit.log.warn(
56-
new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
57-
);
58-
octokit[namespaceName][apiName] = request;
59-
return request.apply(null, arguments);
60-
};
54+
octokit[namespaceName][apiName] = Object.assign(
55+
function deprecatedEndpointMethod() {
56+
octokit.log.warn(
57+
new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
58+
);
59+
octokit[namespaceName][apiName] = request;
60+
return request.apply(null, arguments);
61+
},
62+
request
63+
);
6164

6265
return;
6366
}

0 commit comments

Comments
 (0)