Skip to content

Commit 9701151

Browse files
committed
fix: add .endpoint() method to all deprecated endpoint methods
1 parent dadfe9a commit 9701151

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

plugins/register-endpoints/register-endpoints.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ function registerEndpoints(octokit, routes) {
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)