@@ -40203,24 +40203,19 @@ function lowercaseKeys(object) {
4020340203 }, {});
4020440204}
4020540205function isPlainObject(value) {
40206- if (typeof value !== "object" || value === null)
40207- return false;
40208- if (Object.prototype.toString.call(value) !== "[object Object]")
40209- return false;
40206+ if (typeof value !== "object" || value === null) return false;
40207+ if (Object.prototype.toString.call(value) !== "[object Object]") return false;
4021040208 const proto = Object.getPrototypeOf(value);
40211- if (proto === null)
40212- return true;
40209+ if (proto === null) return true;
4021340210 const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
4021440211 return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
4021540212}
4021640213function mergeDeep(defaults, options) {
4021740214 const result = Object.assign({}, defaults);
4021840215 Object.keys(options).forEach((key) => {
4021940216 if (isPlainObject(options[key])) {
40220- if (!(key in defaults))
40221- Object.assign(result, { [key]: options[key] });
40222- else
40223- result[key] = mergeDeep(defaults[key], options[key]);
40217+ if (!(key in defaults)) Object.assign(result, { [key]: options[key] });
40218+ else result[key] = mergeDeep(defaults[key], options[key]);
4022440219 } else {
4022540220 Object.assign(result, { [key]: options[key] });
4022640221 }
@@ -40269,9 +40264,9 @@ function addQueryParameters(url, parameters) {
4026940264 return `${name}=${encodeURIComponent(parameters[name])}`;
4027040265 }).join("&");
4027140266}
40272- var urlVariableRegex = /\{[^}]+\}/g;
40267+ var urlVariableRegex = /\{[^{} }]+\}/g;
4027340268function removeNonChars(variableName) {
40274- return variableName.replace(/^\W+|\W+$ /g, "").split(/,/);
40269+ return variableName.replace(/(?: ^\W+)|(?:(?<!\W)\W+$) /g, "").split(/,/);
4027540270}
4027640271function extractUrlVariableNames(url) {
4027740272 const matches = url.match(urlVariableRegex);
@@ -40451,7 +40446,7 @@ function parse(options) {
4045140446 }
4045240447 if (url.endsWith("/graphql")) {
4045340448 if (options.mediaType.previews?.length) {
40454- const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
40449+ const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-]) [\w-]+(?=-preview)/g) || [];
4045540450 headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
4045640451 const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
4045740452 return `application/vnd.github.${preview}-preview${format}`;
0 commit comments