Added the node modules.
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 33s

This commit is contained in:
2023-11-19 03:45:16 +01:00
parent cdc71fe250
commit 6e037d6837
416 changed files with 108059 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import { VERSION } from "./version";
/**
* @param octokit Octokit instance
* @param options Options passed to Octokit constructor
*/
export function requestLog(octokit) {
octokit.hook.wrap("request", (request, options) => {
octokit.log.debug("request", options);
const start = Date.now();
const requestOptions = octokit.request.endpoint.parse(options);
const path = requestOptions.url.replace(options.baseUrl, "");
return request(options)
.then((response) => {
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
return response;
})
.catch((error) => {
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
throw error;
});
});
}
requestLog.VERSION = VERSION;