Comparing version 8.4.27 to 8.4.28
@@ -25,5 +25,5 @@ const isReactNative = typeof navigator > "u" ? !1 : navigator.product === "ReactNative", defaultOptions = { timeout: isReactNative ? 6e4 : 12e4 }, processOptions = function(opts) { | ||
return { url, searchParams: new URLSearchParams() }; | ||
const base = url.slice(0, qIndex), qs = url.slice(qIndex + 1), searchParams = new URLSearchParams(qs); | ||
if (typeof searchParams.set == "function") | ||
return { url: base, searchParams }; | ||
const base = url.slice(0, qIndex), qs = url.slice(qIndex + 1); | ||
if (!isReactNative) | ||
return { url: base, searchParams: new URLSearchParams(qs) }; | ||
if (typeof decodeURIComponent != "function") | ||
@@ -30,0 +30,0 @@ throw new Error( |
@@ -25,5 +25,5 @@ const isReactNative = typeof navigator > "u" ? !1 : navigator.product === "ReactNative", defaultOptions = { timeout: isReactNative ? 6e4 : 12e4 }, processOptions = function(opts) { | ||
return { url, searchParams: new URLSearchParams() }; | ||
const base = url.slice(0, qIndex), qs = url.slice(qIndex + 1), searchParams = new URLSearchParams(qs); | ||
if (typeof searchParams.set == "function") | ||
return { url: base, searchParams }; | ||
const base = url.slice(0, qIndex), qs = url.slice(qIndex + 1); | ||
if (!isReactNative) | ||
return { url: base, searchParams: new URLSearchParams(qs) }; | ||
if (typeof decodeURIComponent != "function") | ||
@@ -30,0 +30,0 @@ throw new Error( |
@@ -114,3 +114,3 @@ import { p as processOptions, v as validateOptions, g as getDefaultExportFromCjs } from "./_chunks-es/_commonjsHelpers.js"; | ||
member instanceof WeakSet ? member.add(obj) : member.set(obj, value); | ||
}, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), _method, _url, _resHeaders, _headers, _controller, _init, _useAbortSignal; | ||
}, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value), _method, _url, _resHeaders, _headers, _controller, _init, _useAbortSignal; | ||
class FetchXhr { | ||
@@ -117,0 +117,0 @@ constructor() { |
@@ -23,3 +23,3 @@ import { c as createRequester } from "./_chunks-es/createRequester.js"; | ||
member instanceof WeakSet ? member.add(obj) : member.set(obj, value); | ||
}, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), _method, _url, _resHeaders, _headers, _controller, _init, _useAbortSignal; | ||
}, __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value), _method, _url, _resHeaders, _headers, _controller, _init, _useAbortSignal; | ||
class FetchXhr { | ||
@@ -26,0 +26,0 @@ constructor() { |
{ | ||
"name": "get-it", | ||
"version": "8.4.27", | ||
"version": "8.4.28", | ||
"description": "Generic HTTP request library for node, browsers and workers", | ||
@@ -116,3 +116,3 @@ "keywords": [ | ||
"@edge-runtime/vm": "^3.2.0", | ||
"@sanity/pkg-utils": "^6.8.0", | ||
"@sanity/pkg-utils": "^6.8.10", | ||
"@sanity/semantic-release-preset": "^4.1.7", | ||
@@ -125,5 +125,5 @@ "@types/bun": "^1.1.0", | ||
"@types/zen-observable": "^0.8.7", | ||
"@typescript-eslint/eslint-plugin": "^7.7.0", | ||
"@typescript-eslint/parser": "^7.7.0", | ||
"@vitest/coverage-v8": "^1.5.0", | ||
"@typescript-eslint/eslint-plugin": "^7.8.0", | ||
"@typescript-eslint/parser": "^7.8.0", | ||
"@vitest/coverage-v8": "^1.5.2", | ||
"debug": "4.3.4", | ||
@@ -143,4 +143,4 @@ "eslint": "^8.57.0", | ||
"typescript": "5.4.5", | ||
"vite": "5.2.9", | ||
"vitest": "^1.5.0", | ||
"vite": "5.2.11", | ||
"vitest": "^1.5.2", | ||
"vitest-github-actions-reporter": "^0.11.1", | ||
@@ -147,0 +147,0 @@ "zen-observable": "^0.10.0" |
@@ -62,8 +62,7 @@ import type {MiddlewareHooks, RequestOptions} from 'get-it' | ||
const qs = url.slice(qIndex + 1) | ||
const searchParams = new URLSearchParams(qs) | ||
// Buggy React Native versions do not implement `.set()`, so if we have one, | ||
// we should be able to use a functioning `URLSearchParams` implementation | ||
if (typeof searchParams.set === 'function') { | ||
return {url: base, searchParams} | ||
// React Native's URL and URLSearchParams are broken, so passing a string to URLSearchParams | ||
// does not work, leading to an empty query string. For other environments, this should be enough | ||
if (!isReactNative) { | ||
return {url: base, searchParams: new URLSearchParams(qs)} | ||
} | ||
@@ -79,4 +78,2 @@ | ||
// Another brokenness in React Native: `URLSearchParams` does not accept a string argument, | ||
// so we'll have do attempt to destructure the query string ourselves :( | ||
const params = new URLSearchParams() | ||
@@ -83,0 +80,0 @@ for (const pair of qs.split('&')) { |
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
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
747119
7791