Skip to content

Commit 9854f48

Browse files
build(deps): Bump @octokit/request from 8.1.1 to 8.4.1 (#279)
* build(deps): Bump @octokit/request from 8.1.1 to 8.4.1 Bumps [@octokit/request](https://github.com/octokit/request.js) from 8.1.1 to 8.4.1. - [Release notes](https://github.com/octokit/request.js/releases) - [Commits](octokit/request.js@v8.1.1...v8.4.1) --- updated-dependencies: - dependency-name: "@octokit/request" dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * build --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ben Drucker <[email protected]>
1 parent 081da6a commit 9854f48

File tree

2 files changed

+150
-104
lines changed

2 files changed

+150
-104
lines changed

dist/index.js

Lines changed: 68 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4305,7 +4305,7 @@ module.exports = __toCommonJS(dist_src_exports);
43054305
var import_universal_user_agent = __nccwpck_require__(3843);
43064306

43074307
// pkg/dist-src/version.js
4308-
var VERSION = "9.0.0";
4308+
var VERSION = "9.0.6";
43094309

43104310
// pkg/dist-src/defaults.js
43114311
var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
@@ -4332,12 +4332,24 @@ function lowercaseKeys(object) {
43324332
}, {});
43334333
}
43344334

4335+
// pkg/dist-src/util/is-plain-object.js
4336+
function isPlainObject(value) {
4337+
if (typeof value !== "object" || value === null)
4338+
return false;
4339+
if (Object.prototype.toString.call(value) !== "[object Object]")
4340+
return false;
4341+
const proto = Object.getPrototypeOf(value);
4342+
if (proto === null)
4343+
return true;
4344+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
4345+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
4346+
}
4347+
43354348
// pkg/dist-src/util/merge-deep.js
4336-
var import_is_plain_object = __nccwpck_require__(3407);
43374349
function mergeDeep(defaults, options) {
43384350
const result = Object.assign({}, defaults);
43394351
Object.keys(options).forEach((key) => {
4340-
if ((0, import_is_plain_object.isPlainObject)(options[key])) {
4352+
if (isPlainObject(options[key])) {
43414353
if (!(key in defaults))
43424354
Object.assign(result, { [key]: options[key] });
43434355
else
@@ -4398,9 +4410,9 @@ function addQueryParameters(url, parameters) {
43984410
}
43994411

44004412
// pkg/dist-src/util/extract-url-variable-names.js
4401-
var urlVariableRegex = /\{[^}]+\}/g;
4413+
var urlVariableRegex = /\{[^{}}]+\}/g;
44024414
function removeNonChars(variableName) {
4403-
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
4415+
return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
44044416
}
44054417
function extractUrlVariableNames(url) {
44064418
const matches = url.match(urlVariableRegex);
@@ -4412,10 +4424,13 @@ function extractUrlVariableNames(url) {
44124424

44134425
// pkg/dist-src/util/omit.js
44144426
function omit(object, keysToOmit) {
4415-
return Object.keys(object).filter((option) => !keysToOmit.includes(option)).reduce((obj, key) => {
4416-
obj[key] = object[key];
4417-
return obj;
4418-
}, {});
4427+
const result = { __proto__: null };
4428+
for (const key of Object.keys(object)) {
4429+
if (keysToOmit.indexOf(key) === -1) {
4430+
result[key] = object[key];
4431+
}
4432+
}
4433+
return result;
44194434
}
44204435

44214436
// pkg/dist-src/util/url-template.js
@@ -4513,7 +4528,7 @@ function parseUrl(template) {
45134528
}
45144529
function expand(template, context) {
45154530
var operators = ["+", "#", ".", "/", ";", "?", "&"];
4516-
return template.replace(
4531+
template = template.replace(
45174532
/\{([^\{\}]+)\}|([^\{\}]+)/g,
45184533
function(_, expression, literal) {
45194534
if (expression) {
@@ -4543,6 +4558,11 @@ function expand(template, context) {
45434558
}
45444559
}
45454560
);
4561+
if (template === "/") {
4562+
return template;
4563+
} else {
4564+
return template.replace(/\/$/, "");
4565+
}
45464566
}
45474567

45484568
// pkg/dist-src/parse.js
@@ -4578,7 +4598,7 @@ function parse(options) {
45784598
}
45794599
if (url.endsWith("/graphql")) {
45804600
if (options.mediaType.previews?.length) {
4581-
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
4601+
const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
45824602
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
45834603
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
45844604
return `application/vnd.github.${preview}-preview${format}`;
@@ -7390,10 +7410,22 @@ var import_endpoint = __nccwpck_require__(4471);
73907410
var import_universal_user_agent = __nccwpck_require__(3843);
73917411

73927412
// pkg/dist-src/version.js
7393-
var VERSION = "8.1.1";
7413+
var VERSION = "8.4.1";
7414+
7415+
// pkg/dist-src/is-plain-object.js
7416+
function isPlainObject(value) {
7417+
if (typeof value !== "object" || value === null)
7418+
return false;
7419+
if (Object.prototype.toString.call(value) !== "[object Object]")
7420+
return false;
7421+
const proto = Object.getPrototypeOf(value);
7422+
if (proto === null)
7423+
return true;
7424+
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
7425+
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
7426+
}
73947427

73957428
// pkg/dist-src/fetch-wrapper.js
7396-
var import_is_plain_object = __nccwpck_require__(3407);
73977429
var import_request_error = __nccwpck_require__(3708);
73987430

73997431
// pkg/dist-src/get-buffer-response.js
@@ -7403,10 +7435,10 @@ function getBufferResponse(response) {
74037435

74047436
// pkg/dist-src/fetch-wrapper.js
74057437
function fetchWrapper(requestOptions) {
7406-
var _a, _b, _c;
7438+
var _a, _b, _c, _d;
74077439
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
74087440
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
7409-
if ((0, import_is_plain_object.isPlainObject)(requestOptions.body) || Array.isArray(requestOptions.body)) {
7441+
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
74107442
requestOptions.body = JSON.stringify(requestOptions.body);
74117443
}
74127444
let headers = {};
@@ -7424,8 +7456,9 @@ function fetchWrapper(requestOptions) {
74247456
return fetch(requestOptions.url, {
74257457
method: requestOptions.method,
74267458
body: requestOptions.body,
7459+
redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
74277460
headers: requestOptions.headers,
7428-
signal: (_c = requestOptions.request) == null ? void 0 : _c.signal,
7461+
signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
74297462
// duplex must be set if request.body is ReadableStream or Async Iterables.
74307463
// See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
74317464
...requestOptions.body && { duplex: "half" }
@@ -7436,7 +7469,7 @@ function fetchWrapper(requestOptions) {
74367469
headers[keyAndValue[0]] = keyAndValue[1];
74377470
}
74387471
if ("deprecation" in headers) {
7439-
const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
7472+
const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
74407473
const deprecationLink = matches && matches.pop();
74417474
log.warn(
74427475
`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
@@ -7496,15 +7529,23 @@ function fetchWrapper(requestOptions) {
74967529
throw error;
74977530
else if (error.name === "AbortError")
74987531
throw error;
7499-
throw new import_request_error.RequestError(error.message, 500, {
7532+
let message = error.message;
7533+
if (error.name === "TypeError" && "cause" in error) {
7534+
if (error.cause instanceof Error) {
7535+
message = error.cause.message;
7536+
} else if (typeof error.cause === "string") {
7537+
message = error.cause;
7538+
}
7539+
}
7540+
throw new import_request_error.RequestError(message, 500, {
75007541
request: requestOptions
75017542
});
75027543
});
75037544
}
75047545
async function getResponseData(response) {
75057546
const contentType = response.headers.get("content-type");
75067547
if (/application\/json/.test(contentType)) {
7507-
return response.json();
7548+
return response.json().catch(() => response.text()).catch(() => "");
75087549
}
75097550
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
75107551
return response.text();
@@ -7514,11 +7555,17 @@ async function getResponseData(response) {
75147555
function toErrorMessage(data) {
75157556
if (typeof data === "string")
75167557
return data;
7558+
let suffix;
7559+
if ("documentation_url" in data) {
7560+
suffix = ` - ${data.documentation_url}`;
7561+
} else {
7562+
suffix = "";
7563+
}
75177564
if ("message" in data) {
75187565
if (Array.isArray(data.errors)) {
7519-
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`;
7566+
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
75207567
}
7521-
return data.message;
7568+
return `${data.message}${suffix}`;
75227569
}
75237570
return `Unknown error: ${JSON.stringify(data)}`;
75247571
}
@@ -7818,52 +7865,6 @@ class Deprecation extends Error {
78187865
exports.Deprecation = Deprecation;
78197866

78207867

7821-
/***/ }),
7822-
7823-
/***/ 3407:
7824-
/***/ ((__unused_webpack_module, exports) => {
7825-
7826-
"use strict";
7827-
7828-
7829-
Object.defineProperty(exports, "__esModule", ({ value: true }));
7830-
7831-
/*!
7832-
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
7833-
*
7834-
* Copyright (c) 2014-2017, Jon Schlinkert.
7835-
* Released under the MIT License.
7836-
*/
7837-
7838-
function isObject(o) {
7839-
return Object.prototype.toString.call(o) === '[object Object]';
7840-
}
7841-
7842-
function isPlainObject(o) {
7843-
var ctor,prot;
7844-
7845-
if (isObject(o) === false) return false;
7846-
7847-
// If has modified constructor
7848-
ctor = o.constructor;
7849-
if (ctor === undefined) return true;
7850-
7851-
// If has modified prototype
7852-
prot = ctor.prototype;
7853-
if (isObject(prot) === false) return false;
7854-
7855-
// If constructor does not have an Object-specific method
7856-
if (prot.hasOwnProperty('isPrototypeOf') === false) {
7857-
return false;
7858-
}
7859-
7860-
// Most likely a plain Object
7861-
return true;
7862-
}
7863-
7864-
exports.isPlainObject = isPlainObject;
7865-
7866-
78677868
/***/ }),
78687869

78697870
/***/ 5560:

0 commit comments

Comments
 (0)