semantic-branch-version/node_modules/@octokit/graphql/dist-src/with-defaults.js

13 lines
435 B
JavaScript
Raw Normal View History

2020-07-04 21:41:06 +08:00
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,
});
}