Comparing version 8.6.3 to 8.6.4-canary.0
@@ -180,7 +180,8 @@ import decompressResponse from "decompress-response"; | ||
} | ||
var __defProp = Object.defineProperty, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value); | ||
const isStream = (stream) => stream !== null && typeof stream == "object" && typeof stream.pipe == "function", adapter = "node"; | ||
class NodeRequestError extends Error { | ||
request; | ||
code; | ||
constructor(err, req) { | ||
super(err.message), __publicField(this, "request"), __publicField(this, "code"), this.request = req, this.code = err.code; | ||
super(err.message), this.request = req, this.code = err.code; | ||
} | ||
@@ -187,0 +188,0 @@ } |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type {IncomingHttpHeaders} from 'http' | ||
@@ -4,0 +2,0 @@ import type {IncomingMessage} from 'http' |
@@ -107,56 +107,70 @@ import { processOptions, validateOptions, getDefaultExportFromCjs } from "./_chunks-es/_commonjsHelpers.js"; | ||
return result; | ||
}, parseHeaders$1 = /* @__PURE__ */ getDefaultExportFromCjs(parseHeaders), __defProp = Object.defineProperty, __typeError = (msg) => { | ||
throw TypeError(msg); | ||
}, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg), __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value), _method, _url, _resHeaders, _headers, _controller, _init, _useAbortSignal; | ||
}, parseHeaders$1 = /* @__PURE__ */ getDefaultExportFromCjs(parseHeaders); | ||
class FetchXhr { | ||
constructor() { | ||
__publicField(this, "onabort"), __publicField(this, "onerror"), __publicField(this, "onreadystatechange"), __publicField(this, "ontimeout"), __publicField(this, "readyState", 0), __publicField(this, "response"), __publicField(this, "responseText", ""), __publicField(this, "responseType", ""), __publicField(this, "status"), __publicField(this, "statusText"), __publicField(this, "withCredentials"), __privateAdd(this, _method), __privateAdd(this, _url), __privateAdd(this, _resHeaders), __privateAdd(this, _headers, {}), __privateAdd(this, _controller), __privateAdd(this, _init, {}), __privateAdd(this, _useAbortSignal); | ||
} | ||
/** | ||
* Public interface, interop with real XMLHttpRequest | ||
*/ | ||
onabort; | ||
onerror; | ||
onreadystatechange; | ||
ontimeout; | ||
/** | ||
* https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState | ||
*/ | ||
readyState = 0; | ||
response; | ||
responseText = ""; | ||
responseType = ""; | ||
status; | ||
statusText; | ||
withCredentials; | ||
/** | ||
* Private implementation details | ||
*/ | ||
#method; | ||
#url; | ||
#resHeaders; | ||
#headers = {}; | ||
#controller; | ||
#init = {}; | ||
#useAbortSignal; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- _async is only declared for typings compatibility | ||
open(method, url, _async) { | ||
var _a; | ||
__privateSet(this, _method, method), __privateSet(this, _url, url), __privateSet(this, _resHeaders, ""), this.readyState = 1, (_a = this.onreadystatechange) == null || _a.call(this), __privateSet(this, _controller, void 0); | ||
this.#method = method, this.#url = url, this.#resHeaders = "", this.readyState = 1, this.onreadystatechange?.(), this.#controller = void 0; | ||
} | ||
abort() { | ||
__privateGet(this, _controller) && __privateGet(this, _controller).abort(); | ||
this.#controller && this.#controller.abort(); | ||
} | ||
getAllResponseHeaders() { | ||
return __privateGet(this, _resHeaders); | ||
return this.#resHeaders; | ||
} | ||
setRequestHeader(name, value) { | ||
__privateGet(this, _headers)[name] = value; | ||
this.#headers[name] = value; | ||
} | ||
// Allow setting extra fetch init options, needed for runtimes such as Vercel Edge to set `cache` and other options in React Server Components | ||
setInit(init, useAbortSignal = !0) { | ||
__privateSet(this, _init, init), __privateSet(this, _useAbortSignal, useAbortSignal); | ||
this.#init = init, this.#useAbortSignal = useAbortSignal; | ||
} | ||
send(body) { | ||
const textBody = this.responseType !== "arraybuffer", options = { | ||
...__privateGet(this, _init), | ||
method: __privateGet(this, _method), | ||
headers: __privateGet(this, _headers), | ||
...this.#init, | ||
method: this.#method, | ||
headers: this.#headers, | ||
body | ||
}; | ||
typeof AbortController == "function" && __privateGet(this, _useAbortSignal) && (__privateSet(this, _controller, new AbortController()), typeof EventTarget < "u" && __privateGet(this, _controller).signal instanceof EventTarget && (options.signal = __privateGet(this, _controller).signal)), typeof document < "u" && (options.credentials = this.withCredentials ? "include" : "omit"), fetch(__privateGet(this, _url), options).then((res) => { | ||
var _a; | ||
return res.headers.forEach((value, key) => { | ||
__privateSet(this, _resHeaders, __privateGet(this, _resHeaders) + `${key}: ${value}\r | ||
`); | ||
}), this.status = res.status, this.statusText = res.statusText, this.readyState = 3, (_a = this.onreadystatechange) == null || _a.call(this), textBody ? res.text() : res.arrayBuffer(); | ||
}).then((resBody) => { | ||
var _a; | ||
typeof resBody == "string" ? this.responseText = resBody : this.response = resBody, this.readyState = 4, (_a = this.onreadystatechange) == null || _a.call(this); | ||
typeof AbortController == "function" && this.#useAbortSignal && (this.#controller = new AbortController(), typeof EventTarget < "u" && this.#controller.signal instanceof EventTarget && (options.signal = this.#controller.signal)), typeof document < "u" && (options.credentials = this.withCredentials ? "include" : "omit"), fetch(this.#url, options).then((res) => (res.headers.forEach((value, key) => { | ||
this.#resHeaders += `${key}: ${value}\r | ||
`; | ||
}), this.status = res.status, this.statusText = res.statusText, this.readyState = 3, this.onreadystatechange?.(), textBody ? res.text() : res.arrayBuffer())).then((resBody) => { | ||
typeof resBody == "string" ? this.responseText = resBody : this.response = resBody, this.readyState = 4, this.onreadystatechange?.(); | ||
}).catch((err) => { | ||
var _a, _b; | ||
if (err.name === "AbortError") { | ||
(_a = this.onabort) == null || _a.call(this); | ||
this.onabort?.(); | ||
return; | ||
} | ||
(_b = this.onerror) == null || _b.call(this, err); | ||
this.onerror?.(err); | ||
}); | ||
} | ||
} | ||
_method = /* @__PURE__ */ new WeakMap(), _url = /* @__PURE__ */ new WeakMap(), _resHeaders = /* @__PURE__ */ new WeakMap(), _headers = /* @__PURE__ */ new WeakMap(), _controller = /* @__PURE__ */ new WeakMap(), _init = /* @__PURE__ */ new WeakMap(), _useAbortSignal = /* @__PURE__ */ new WeakMap(); | ||
const adapter = typeof XMLHttpRequest == "function" ? "xhr" : "fetch", XmlHttpRequest = adapter === "xhr" ? XMLHttpRequest : FetchXhr, httpRequester = (context, callback) => { | ||
var _a; | ||
const opts = context.options, options = context.applyMiddleware("finalizeOptions", opts), timers = {}, injectedResponse = context.applyMiddleware("interceptRequest", void 0, { | ||
@@ -171,3 +185,3 @@ adapter, | ||
let xhr = new XmlHttpRequest(); | ||
xhr instanceof FetchXhr && typeof options.fetch == "object" && xhr.setInit(options.fetch, (_a = options.useAbortSignal) != null ? _a : !0); | ||
xhr instanceof FetchXhr && typeof options.fetch == "object" && xhr.setInit(options.fetch, options.useAbortSignal ?? !0); | ||
const headers = options.headers, delays = options.timeout; | ||
@@ -174,0 +188,0 @@ let aborted = !1, loaded = !1, timedOut = !1; |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type {IncomingHttpHeaders} from 'http' | ||
@@ -4,0 +2,0 @@ import type {IncomingMessage} from 'http' |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type {IncomingHttpHeaders} from 'http' | ||
@@ -4,0 +2,0 @@ import type {IncomingMessage} from 'http' |
@@ -16,56 +16,70 @@ import { createRequester } from "./_chunks-es/createRequester.js"; | ||
return result; | ||
}, parseHeaders$1 = /* @__PURE__ */ getDefaultExportFromCjs(parseHeaders), __defProp = Object.defineProperty, __typeError = (msg) => { | ||
throw TypeError(msg); | ||
}, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg), __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value), _method, _url, _resHeaders, _headers, _controller, _init, _useAbortSignal; | ||
}, parseHeaders$1 = /* @__PURE__ */ getDefaultExportFromCjs(parseHeaders); | ||
class FetchXhr { | ||
constructor() { | ||
__publicField(this, "onabort"), __publicField(this, "onerror"), __publicField(this, "onreadystatechange"), __publicField(this, "ontimeout"), __publicField(this, "readyState", 0), __publicField(this, "response"), __publicField(this, "responseText", ""), __publicField(this, "responseType", ""), __publicField(this, "status"), __publicField(this, "statusText"), __publicField(this, "withCredentials"), __privateAdd(this, _method), __privateAdd(this, _url), __privateAdd(this, _resHeaders), __privateAdd(this, _headers, {}), __privateAdd(this, _controller), __privateAdd(this, _init, {}), __privateAdd(this, _useAbortSignal); | ||
} | ||
/** | ||
* Public interface, interop with real XMLHttpRequest | ||
*/ | ||
onabort; | ||
onerror; | ||
onreadystatechange; | ||
ontimeout; | ||
/** | ||
* https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState | ||
*/ | ||
readyState = 0; | ||
response; | ||
responseText = ""; | ||
responseType = ""; | ||
status; | ||
statusText; | ||
withCredentials; | ||
/** | ||
* Private implementation details | ||
*/ | ||
#method; | ||
#url; | ||
#resHeaders; | ||
#headers = {}; | ||
#controller; | ||
#init = {}; | ||
#useAbortSignal; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- _async is only declared for typings compatibility | ||
open(method, url, _async) { | ||
var _a; | ||
__privateSet(this, _method, method), __privateSet(this, _url, url), __privateSet(this, _resHeaders, ""), this.readyState = 1, (_a = this.onreadystatechange) == null || _a.call(this), __privateSet(this, _controller, void 0); | ||
this.#method = method, this.#url = url, this.#resHeaders = "", this.readyState = 1, this.onreadystatechange?.(), this.#controller = void 0; | ||
} | ||
abort() { | ||
__privateGet(this, _controller) && __privateGet(this, _controller).abort(); | ||
this.#controller && this.#controller.abort(); | ||
} | ||
getAllResponseHeaders() { | ||
return __privateGet(this, _resHeaders); | ||
return this.#resHeaders; | ||
} | ||
setRequestHeader(name, value) { | ||
__privateGet(this, _headers)[name] = value; | ||
this.#headers[name] = value; | ||
} | ||
// Allow setting extra fetch init options, needed for runtimes such as Vercel Edge to set `cache` and other options in React Server Components | ||
setInit(init, useAbortSignal = !0) { | ||
__privateSet(this, _init, init), __privateSet(this, _useAbortSignal, useAbortSignal); | ||
this.#init = init, this.#useAbortSignal = useAbortSignal; | ||
} | ||
send(body) { | ||
const textBody = this.responseType !== "arraybuffer", options = { | ||
...__privateGet(this, _init), | ||
method: __privateGet(this, _method), | ||
headers: __privateGet(this, _headers), | ||
...this.#init, | ||
method: this.#method, | ||
headers: this.#headers, | ||
body | ||
}; | ||
typeof AbortController == "function" && __privateGet(this, _useAbortSignal) && (__privateSet(this, _controller, new AbortController()), typeof EventTarget < "u" && __privateGet(this, _controller).signal instanceof EventTarget && (options.signal = __privateGet(this, _controller).signal)), typeof document < "u" && (options.credentials = this.withCredentials ? "include" : "omit"), fetch(__privateGet(this, _url), options).then((res) => { | ||
var _a; | ||
return res.headers.forEach((value, key) => { | ||
__privateSet(this, _resHeaders, __privateGet(this, _resHeaders) + `${key}: ${value}\r | ||
`); | ||
}), this.status = res.status, this.statusText = res.statusText, this.readyState = 3, (_a = this.onreadystatechange) == null || _a.call(this), textBody ? res.text() : res.arrayBuffer(); | ||
}).then((resBody) => { | ||
var _a; | ||
typeof resBody == "string" ? this.responseText = resBody : this.response = resBody, this.readyState = 4, (_a = this.onreadystatechange) == null || _a.call(this); | ||
typeof AbortController == "function" && this.#useAbortSignal && (this.#controller = new AbortController(), typeof EventTarget < "u" && this.#controller.signal instanceof EventTarget && (options.signal = this.#controller.signal)), typeof document < "u" && (options.credentials = this.withCredentials ? "include" : "omit"), fetch(this.#url, options).then((res) => (res.headers.forEach((value, key) => { | ||
this.#resHeaders += `${key}: ${value}\r | ||
`; | ||
}), this.status = res.status, this.statusText = res.statusText, this.readyState = 3, this.onreadystatechange?.(), textBody ? res.text() : res.arrayBuffer())).then((resBody) => { | ||
typeof resBody == "string" ? this.responseText = resBody : this.response = resBody, this.readyState = 4, this.onreadystatechange?.(); | ||
}).catch((err) => { | ||
var _a, _b; | ||
if (err.name === "AbortError") { | ||
(_a = this.onabort) == null || _a.call(this); | ||
this.onabort?.(); | ||
return; | ||
} | ||
(_b = this.onerror) == null || _b.call(this, err); | ||
this.onerror?.(err); | ||
}); | ||
} | ||
} | ||
_method = /* @__PURE__ */ new WeakMap(), _url = /* @__PURE__ */ new WeakMap(), _resHeaders = /* @__PURE__ */ new WeakMap(), _headers = /* @__PURE__ */ new WeakMap(), _controller = /* @__PURE__ */ new WeakMap(), _init = /* @__PURE__ */ new WeakMap(), _useAbortSignal = /* @__PURE__ */ new WeakMap(); | ||
const adapter = typeof XMLHttpRequest == "function" ? "xhr" : "fetch", XmlHttpRequest = adapter === "xhr" ? XMLHttpRequest : FetchXhr, httpRequester = (context, callback) => { | ||
var _a; | ||
const opts = context.options, options = context.applyMiddleware("finalizeOptions", opts), timers = {}, injectedResponse = context.applyMiddleware("interceptRequest", void 0, { | ||
@@ -80,3 +94,3 @@ adapter, | ||
let xhr = new XmlHttpRequest(); | ||
xhr instanceof FetchXhr && typeof options.fetch == "object" && xhr.setInit(options.fetch, (_a = options.useAbortSignal) != null ? _a : !0); | ||
xhr instanceof FetchXhr && typeof options.fetch == "object" && xhr.setInit(options.fetch, options.useAbortSignal ?? !0); | ||
const headers = options.headers, delays = options.timeout; | ||
@@ -83,0 +97,0 @@ let aborted = !1, loaded = !1, timedOut = !1; |
@@ -99,5 +99,5 @@ import {FinalizeNodeOptionsPayload} from 'get-it' | ||
export declare const keepAlive: (config?: { | ||
ms?: number | undefined | ||
maxFree?: number | undefined | ||
maxRetries?: number | undefined | ||
ms?: number | ||
maxFree?: number | ||
maxRetries?: number | ||
}) => any | ||
@@ -125,23 +125,23 @@ | ||
body?: any | ||
bodySize?: number | undefined | ||
bodySize?: number | ||
cancelToken?: any | ||
compress?: boolean | undefined | ||
compress?: boolean | ||
headers?: any | ||
maxRedirects?: number | undefined | ||
maxRetries?: number | undefined | ||
retryDelay?: ((attemptNumber: number) => number) | undefined | ||
method?: string | undefined | ||
maxRedirects?: number | ||
maxRetries?: number | ||
retryDelay?: (attemptNumber: number) => number | ||
method?: string | ||
proxy?: any | ||
query?: any | ||
rawBody?: boolean | undefined | ||
rawBody?: boolean | ||
shouldRetry?: any | ||
stream?: boolean | undefined | ||
stream?: boolean | ||
timeout: any | ||
tunnel?: boolean | undefined | ||
tunnel?: boolean | ||
debug?: any | ||
requestId?: number | undefined | ||
attemptNumber?: number | undefined | ||
withCredentials?: boolean | undefined | ||
fetch?: boolean | Omit<RequestInit, 'method'> | undefined | ||
useAbortSignal?: boolean | undefined | ||
requestId?: number | ||
attemptNumber?: number | ||
withCredentials?: boolean | ||
fetch?: boolean | Omit<RequestInit, 'method'> | ||
useAbortSignal?: boolean | ||
} | ||
@@ -148,0 +148,0 @@ |
@@ -368,6 +368,7 @@ import { getDefaultExportFromCjs } from "./_chunks-es/_commonjsHelpers.js"; | ||
} | ||
var __defProp$2 = Object.defineProperty, __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key != "symbol" ? key + "" : key, value); | ||
class HttpError extends Error { | ||
response; | ||
request; | ||
constructor(res, ctx) { | ||
super(), __publicField$2(this, "response"), __publicField$2(this, "request"); | ||
super(); | ||
const truncatedUrl = res.url.length > 400 ? `${res.url.slice(0, 399)}\u2026` : res.url; | ||
@@ -521,3 +522,2 @@ let msg = `${res.method}-request to ${truncatedUrl} resulted in `; | ||
} | ||
var __defProp$1 = Object.defineProperty, __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value); | ||
const promise = (options = {}) => { | ||
@@ -545,4 +545,6 @@ const PromiseImplementation = options.implementation || Promise; | ||
class Cancel { | ||
__CANCEL__ = !0; | ||
message; | ||
constructor(message) { | ||
__publicField$1(this, "__CANCEL__", !0), __publicField$1(this, "message"), this.message = message; | ||
this.message = message; | ||
} | ||
@@ -553,5 +555,7 @@ toString() { | ||
} | ||
const _CancelToken = class { | ||
class CancelToken { | ||
promise; | ||
reason; | ||
constructor(executor) { | ||
if (__publicField$1(this, "promise"), __publicField$1(this, "reason"), typeof executor != "function") | ||
if (typeof executor != "function") | ||
throw new TypeError("executor must be a function."); | ||
@@ -565,14 +569,13 @@ let resolvePromise = null; | ||
} | ||
}; | ||
__publicField$1(_CancelToken, "source", () => { | ||
let cancel; | ||
return { | ||
token: new _CancelToken((can) => { | ||
cancel = can; | ||
}), | ||
cancel | ||
static source = () => { | ||
let cancel; | ||
return { | ||
token: new CancelToken((can) => { | ||
cancel = can; | ||
}), | ||
cancel | ||
}; | ||
}; | ||
}); | ||
let CancelToken = _CancelToken; | ||
const isCancel = (value) => !!(value && value != null && value.__CANCEL__); | ||
} | ||
const isCancel = (value) => !!(value && value?.__CANCEL__); | ||
promise.Cancel = Cancel; | ||
@@ -643,6 +646,7 @@ promise.CancelToken = CancelToken; | ||
} | ||
var __defProp = Object.defineProperty, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value); | ||
class NodeRequestError extends Error { | ||
request; | ||
code; | ||
constructor(err, req) { | ||
super(err.message), __publicField(this, "request"), __publicField(this, "code"), this.request = req, this.code = err.code; | ||
super(err.message), this.request = req, this.code = err.code; | ||
} | ||
@@ -649,0 +653,0 @@ } |
@@ -1,3 +0,1 @@ | ||
/// <reference types="node" /> | ||
import {AgentOptions} from 'http' | ||
@@ -108,5 +106,5 @@ import {FinalizeNodeOptionsPayload} from 'get-it' | ||
export declare const keepAlive: (config?: { | ||
ms?: number | undefined | ||
maxFree?: number | undefined | ||
maxRetries?: number | undefined | ||
ms?: number | ||
maxFree?: number | ||
maxRetries?: number | ||
}) => any | ||
@@ -134,23 +132,23 @@ | ||
body?: any | ||
bodySize?: number | undefined | ||
bodySize?: number | ||
cancelToken?: any | ||
compress?: boolean | undefined | ||
compress?: boolean | ||
headers?: any | ||
maxRedirects?: number | undefined | ||
maxRetries?: number | undefined | ||
retryDelay?: ((attemptNumber: number) => number) | undefined | ||
method?: string | undefined | ||
maxRedirects?: number | ||
maxRetries?: number | ||
retryDelay?: (attemptNumber: number) => number | ||
method?: string | ||
proxy?: any | ||
query?: any | ||
rawBody?: boolean | undefined | ||
rawBody?: boolean | ||
shouldRetry?: any | ||
stream?: boolean | undefined | ||
stream?: boolean | ||
timeout: any | ||
tunnel?: boolean | undefined | ||
tunnel?: boolean | ||
debug?: any | ||
requestId?: number | undefined | ||
attemptNumber?: number | undefined | ||
withCredentials?: boolean | undefined | ||
fetch?: boolean | Omit<RequestInit, 'method'> | undefined | ||
useAbortSignal?: boolean | undefined | ||
requestId?: number | ||
attemptNumber?: number | ||
withCredentials?: boolean | ||
fetch?: boolean | Omit<RequestInit, 'method'> | ||
useAbortSignal?: boolean | ||
} | ||
@@ -157,0 +155,0 @@ |
@@ -553,6 +553,7 @@ import { Agent } from "http"; | ||
} | ||
var __defProp$1 = Object.defineProperty, __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value); | ||
class HttpError extends Error { | ||
response; | ||
request; | ||
constructor(res, ctx) { | ||
super(), __publicField$1(this, "response"), __publicField$1(this, "request"); | ||
super(); | ||
const truncatedUrl = res.url.length > 400 ? `${res.url.slice(0, 399)}\u2026` : res.url; | ||
@@ -710,3 +711,2 @@ let msg = `${res.method}-request to ${truncatedUrl} resulted in `; | ||
} | ||
var __defProp = Object.defineProperty, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value); | ||
const promise = (options = {}) => { | ||
@@ -734,4 +734,6 @@ const PromiseImplementation = options.implementation || Promise; | ||
class Cancel { | ||
__CANCEL__ = !0; | ||
message; | ||
constructor(message) { | ||
__publicField(this, "__CANCEL__", !0), __publicField(this, "message"), this.message = message; | ||
this.message = message; | ||
} | ||
@@ -742,5 +744,7 @@ toString() { | ||
} | ||
const _CancelToken = class { | ||
class CancelToken { | ||
promise; | ||
reason; | ||
constructor(executor) { | ||
if (__publicField(this, "promise"), __publicField(this, "reason"), typeof executor != "function") | ||
if (typeof executor != "function") | ||
throw new TypeError("executor must be a function."); | ||
@@ -754,14 +758,13 @@ let resolvePromise = null; | ||
} | ||
}; | ||
__publicField(_CancelToken, "source", () => { | ||
let cancel; | ||
return { | ||
token: new _CancelToken((can) => { | ||
cancel = can; | ||
}), | ||
cancel | ||
static source = () => { | ||
let cancel; | ||
return { | ||
token: new CancelToken((can) => { | ||
cancel = can; | ||
}), | ||
cancel | ||
}; | ||
}; | ||
}); | ||
let CancelToken = _CancelToken; | ||
const isCancel = (value) => !!(value && value != null && value.__CANCEL__); | ||
} | ||
const isCancel = (value) => !!(value && value?.__CANCEL__); | ||
promise.Cancel = Cancel; | ||
@@ -768,0 +771,0 @@ promise.CancelToken = CancelToken; |
{ | ||
"name": "get-it", | ||
"version": "8.6.3", | ||
"version": "8.6.4-canary.0", | ||
"description": "Generic HTTP request library for node, browsers and workers", | ||
@@ -109,4 +109,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@edge-runtime/vm": "^3.2.0", | ||
"@sanity/pkg-utils": "^6.10.2", | ||
"@edge-runtime/vm": "^4.0.1", | ||
"@sanity/pkg-utils": "^6.10.9", | ||
"@sanity/semantic-release-preset": "^5.0.0", | ||
@@ -119,5 +119,5 @@ "@types/bun": "^1.1.6", | ||
"@types/zen-observable": "^0.8.7", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"@typescript-eslint/eslint-plugin": "^7.16.0", | ||
"@typescript-eslint/parser": "^7.16.0", | ||
"@vitest/coverage-v8": "^2.0.1", | ||
"debug": "4.3.4", | ||
@@ -127,15 +127,15 @@ "eslint": "^8.57.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-simple-import-sort": "^12.1.0", | ||
"eslint-plugin-simple-import-sort": "^12.1.1", | ||
"faucet": "^0.0.4", | ||
"get-uri": "^6.0.2", | ||
"happy-dom": "12.10.3", | ||
"ls-engines": "^0.9.2", | ||
"ls-engines": "^0.9.3", | ||
"node-fetch": "^2.6.7", | ||
"parse-headers": "2.0.5", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-packagejson": "^2.5.0", | ||
"prettier-plugin-packagejson": "^2.5.1", | ||
"semantic-release": "^24.0.0", | ||
"typescript": "5.4.5", | ||
"vite": "5.3.3", | ||
"vitest": "^1.6.0", | ||
"typescript": "5.5.3", | ||
"vite": "5.3.5", | ||
"vitest": "^2.0.1", | ||
"vitest-github-actions-reporter": "^0.11.1", | ||
@@ -142,0 +142,0 @@ "zen-observable": "^0.10.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8019
780534
1