mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-13 19:54:20 +00:00
node_modules
This commit is contained in:
parent
29058f2f68
commit
a40b254993
445 changed files with 83959 additions and 2 deletions
22
node_modules/@octokit/request/dist-src/with-defaults.js
generated
vendored
Normal file
22
node_modules/@octokit/request/dist-src/with-defaults.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
import fetchWrapper from "./fetch-wrapper";
|
||||
export default function withDefaults(oldEndpoint, newDefaults) {
|
||||
const endpoint = oldEndpoint.defaults(newDefaults);
|
||||
const newApi = function (route, parameters) {
|
||||
const endpointOptions = endpoint.merge(route, parameters);
|
||||
if (!endpointOptions.request || !endpointOptions.request.hook) {
|
||||
return fetchWrapper(endpoint.parse(endpointOptions));
|
||||
}
|
||||
const request = (route, parameters) => {
|
||||
return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
|
||||
};
|
||||
Object.assign(request, {
|
||||
endpoint,
|
||||
defaults: withDefaults.bind(null, endpoint)
|
||||
});
|
||||
return endpointOptions.request.hook(request, endpointOptions);
|
||||
};
|
||||
return Object.assign(newApi, {
|
||||
endpoint,
|
||||
defaults: withDefaults.bind(null, endpoint)
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue