change-string-case/node_modules/@octokit/graphql/dist-src/with-defaults.js

16 lines
435 B
JavaScript
Raw Normal View History

2022-11-04 00:55:07 +08:00
import { request as Request } from "@octokit/request";
import { graphql } from "./graphql";
2023-10-26 04:27:07 +08:00
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: newRequest.endpoint
});
2022-11-04 00:55:07 +08:00
}
2023-10-26 04:27:07 +08:00
export {
withDefaults
};