mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
13 lines
434 B
JavaScript
13 lines
434 B
JavaScript
|
import { request as Request } from "@octokit/request";
|
||
|
import { graphql } from "./graphql";
|
||
|
export function withDefaults(request, newDefaults) {
|
||
|
const newRequest = request.defaults(newDefaults);
|
||
|
const newApi = (query, options) => {
|
||
|
return graphql(newRequest, query, options);
|
||
|
};
|
||
|
return Object.assign(newApi, {
|
||
|
defaults: withDefaults.bind(null, newRequest),
|
||
|
endpoint: Request.endpoint
|
||
|
});
|
||
|
}
|