Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: add .endpoint() method to all deprecated endpoint methods
  • Loading branch information
gr2m committed Jan 24, 2020
1 parent dadfe9a commit 9701151
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions plugins/register-endpoints/register-endpoints.js
Expand Up @@ -51,13 +51,16 @@ function registerEndpoints(octokit, routes) {
}

if (apiOptions.deprecated) {
octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
octokit.log.warn(
new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
);
octokit[namespaceName][apiName] = request;
return request.apply(null, arguments);
};
octokit[namespaceName][apiName] = Object.assign(
function deprecatedEndpointMethod() {
octokit.log.warn(
new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
);
octokit[namespaceName][apiName] = request;
return request.apply(null, arguments);
},
request
);

return;
}
Expand Down

0 comments on commit 9701151

Please sign in to comment.