@mherod/get-cookie 2.0.0-rc.16 → 2.0.0-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -1
- package/package.json +1 -1
- package/src/fetchWithCookies.ts +8 -3
package/dist/index.js
CHANGED
|
@@ -790,7 +790,10 @@ function $2d84054eb5f070a6$export$f266452a5050185d(url) {
|
|
|
790
790
|
|
|
791
791
|
const $cfc07ae4aa2c7e44$var$userAgent = new (0, ($parcel$interopDefault($7oI3p$useragents)))().toString();
|
|
792
792
|
async function $cfc07ae4aa2c7e44$export$b24a545a0b39f491(url, options = {}, fetch = (0, $7oI3p$crossfetch.fetch), originalRequest) {
|
|
793
|
-
const originalRequest1 = originalRequest ||
|
|
793
|
+
const originalRequest1 = originalRequest || {
|
|
794
|
+
url: url,
|
|
795
|
+
options: options
|
|
796
|
+
};
|
|
794
797
|
const headers = {
|
|
795
798
|
"User-Agent": $cfc07ae4aa2c7e44$var$userAgent
|
|
796
799
|
};
|
package/package.json
CHANGED
package/src/fetchWithCookies.ts
CHANGED
|
@@ -14,13 +14,18 @@ import CookieSpec from "./CookieSpec";
|
|
|
14
14
|
|
|
15
15
|
const userAgent = new UserAgent().toString();
|
|
16
16
|
|
|
17
|
+
interface FetchRequestInit {
|
|
18
|
+
url: RequestInfo | URL | string;
|
|
19
|
+
options?: RequestInit;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
export async function fetchWithCookies(
|
|
18
|
-
url: RequestInfo | URL,
|
|
23
|
+
url: RequestInfo | URL | string,
|
|
19
24
|
options: RequestInit | undefined = {},
|
|
20
25
|
fetch: Function = fetchImpl,
|
|
21
|
-
originalRequest:
|
|
26
|
+
originalRequest: FetchRequestInit | undefined = undefined
|
|
22
27
|
): Promise<Response> {
|
|
23
|
-
const originalRequest1 = originalRequest ||
|
|
28
|
+
const originalRequest1 = originalRequest || { url, options };
|
|
24
29
|
const headers: HeadersInit = {
|
|
25
30
|
"User-Agent": userAgent,
|
|
26
31
|
};
|