Skip to content

Commit

Permalink
Merge pull request #140 from babbel/dependabot/npm_and_yarn/octokit/g…
Browse files Browse the repository at this point in the history
…raphql-8.2.1

Bump @octokit/graphql from 8.2.0 to 8.2.1
  • Loading branch information
jtsaito authored Feb 18, 2025
2 parents 6cec545 + 9f486f4 commit fbae6c2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 37 deletions.
38 changes: 18 additions & 20 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32173,13 +32173,10 @@ function lowercaseKeys(object) {

// pkg/dist-src/util/is-plain-object.js
function isPlainObject(value) {
if (typeof value !== "object" || value === null)
return false;
if (Object.prototype.toString.call(value) !== "[object Object]")
return false;
if (typeof value !== "object" || value === null) return false;
if (Object.prototype.toString.call(value) !== "[object Object]") return false;
const proto = Object.getPrototypeOf(value);
if (proto === null)
return true;
if (proto === null) return true;
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
}
Expand All @@ -32189,10 +32186,8 @@ function mergeDeep(defaults, options) {
const result = Object.assign({}, defaults);
Object.keys(options).forEach((key) => {
if (isPlainObject(options[key])) {
if (!(key in defaults))
Object.assign(result, { [key]: options[key] });
else
result[key] = mergeDeep(defaults[key], options[key]);
if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
else result[key] = mergeDeep(defaults[key], options[key]);
} else {
Object.assign(result, { [key]: options[key] });
}
Expand Down Expand Up @@ -32249,9 +32244,9 @@ function addQueryParameters(url, parameters) {
}

// pkg/dist-src/util/extract-url-variable-names.js
var urlVariableRegex = /\{[^}]+\}/g;
var urlVariableRegex = /\{[^{}}]+\}/g;
function removeNonChars(variableName) {
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
}
function extractUrlVariableNames(url) {
const matches = url.match(urlVariableRegex);
Expand Down Expand Up @@ -32437,7 +32432,7 @@ function parse(options) {
}
if (url.endsWith("/graphql")) {
if (options.mediaType.previews?.length) {
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
return `application/vnd.github.${preview}-preview${format}`;
Expand Down Expand Up @@ -32509,19 +32504,19 @@ class RequestError extends Error {
response;
constructor(message, statusCode, options) {
super(message);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
this.status = Number.parseInt(statusCode);
if (Number.isNaN(this.status)) {
this.status = 0;
}
if ("response" in options) {
this.response = options.response;
}
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]"
)
});
Expand Down Expand Up @@ -32627,7 +32622,7 @@ async function fetchWrapper(requestOptions) {
data: ""
};
if ("deprecation" in responseHeaders) {
const matches = responseHeaders.link && responseHeaders.link.match(/<([^>]+)>; rel="deprecation"/);
const matches = responseHeaders.link && responseHeaders.link.match(/<([^<>]+)>; rel="deprecation"/);
const deprecationLink = matches && matches.pop();
log.warn(
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${responseHeaders.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
Expand Down Expand Up @@ -32668,7 +32663,7 @@ async function getResponseData(response) {
return response.text().catch(() => "");
}
const mimetype = (0,fast_content_type_parse/* safeParse */.xL)(contentType);
if (mimetype.type === "application/json") {
if (isJSONResponse(mimetype)) {
let text = "";
try {
text = await response.text();
Expand All @@ -32682,6 +32677,9 @@ async function getResponseData(response) {
return response.arrayBuffer().catch(() => new ArrayBuffer(0));
}
}
function isJSONResponse(mimetype) {
return mimetype.type === "application/json" || mimetype.type === "application/scim+json";
}
function toErrorMessage(data) {
if (typeof data === "string") {
return data;
Expand Down
37 changes: 20 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fbae6c2

Please sign in to comment.