Github actions require checking in the entire node_modules or using a vercel service what the fuck github
This commit is contained in:
56
node_modules/@octokit/request-error/dist-src/index.js
generated
vendored
Normal file
56
node_modules/@octokit/request-error/dist-src/index.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Deprecation } from "deprecation";
|
||||
import once from "once";
|
||||
const logOnceCode = once((deprecation) => console.warn(deprecation));
|
||||
const logOnceHeaders = once((deprecation) => console.warn(deprecation));
|
||||
class RequestError extends Error {
|
||||
constructor(message, statusCode, options) {
|
||||
super(message);
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
this.name = "HttpError";
|
||||
this.status = statusCode;
|
||||
let headers;
|
||||
if ("headers" in options && typeof options.headers !== "undefined") {
|
||||
headers = options.headers;
|
||||
}
|
||||
if ("response" in options) {
|
||||
this.response = options.response;
|
||||
headers = options.response.headers;
|
||||
}
|
||||
const requestCopy = Object.assign({}, options.request);
|
||||
if (options.request.headers.authorization) {
|
||||
requestCopy.headers = Object.assign({}, options.request.headers, {
|
||||
authorization: options.request.headers.authorization.replace(
|
||||
/ .*$/,
|
||||
" [REDACTED]"
|
||||
)
|
||||
});
|
||||
}
|
||||
requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
|
||||
this.request = requestCopy;
|
||||
Object.defineProperty(this, "code", {
|
||||
get() {
|
||||
logOnceCode(
|
||||
new Deprecation(
|
||||
"[@octokit/request-error] `error.code` is deprecated, use `error.status`."
|
||||
)
|
||||
);
|
||||
return statusCode;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(this, "headers", {
|
||||
get() {
|
||||
logOnceHeaders(
|
||||
new Deprecation(
|
||||
"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
|
||||
)
|
||||
);
|
||||
return headers || {};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
export {
|
||||
RequestError
|
||||
};
|
||||
Reference in New Issue
Block a user