@algolia/requester-browser-xhr
Advanced tools
Comparing version 5.1.1 to 5.2.1
@@ -22,4 +22,3 @@ import { createEchoRequester } from '@algolia/client-common'; | ||
baseRequester.onreadystatechange = () => { | ||
if (baseRequester.readyState > baseRequester.OPENED && | ||
responseTimeout === undefined) { | ||
if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) { | ||
clearTimeout(connectTimeout); | ||
@@ -26,0 +25,0 @@ responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout'); |
{ | ||
"name": "@algolia/requester-browser-xhr", | ||
"version": "5.1.1", | ||
"version": "5.2.1", | ||
"description": "Promise-based request library for browser using xhr.", | ||
@@ -26,12 +26,12 @@ "repository": { | ||
"dependencies": { | ||
"@algolia/client-common": "5.1.1" | ||
"@algolia/client-common": "5.2.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "7.25.3", | ||
"@babel/preset-env": "7.25.4", | ||
"@babel/preset-typescript": "7.24.7", | ||
"@types/jest": "29.5.12", | ||
"@types/node": "20.14.14", | ||
"@types/node": "22.5.0", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "29.7.0", | ||
"ts-jest": "29.2.4", | ||
"ts-jest": "29.2.5", | ||
"typescript": "5.5.4", | ||
@@ -38,0 +38,0 @@ "xhr-mock": "2.5.1" |
@@ -213,5 +213,3 @@ import type http from 'http'; | ||
it('resolves general network errors', async () => { | ||
mock.post(BASE_URL, () => | ||
Promise.reject(new Error('This is a general error')) | ||
); | ||
mock.post(BASE_URL, () => Promise.reject(new Error('This is a general error'))); | ||
@@ -218,0 +216,0 @@ const response = await requester.send(requestStub); |
@@ -11,5 +11,3 @@ import type { EndRequest, Requester, Response } from '@algolia/client-common'; | ||
Object.keys(request.headers).forEach((key) => | ||
baseRequester.setRequestHeader(key, request.headers[key]) | ||
); | ||
Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key])); | ||
@@ -28,6 +26,3 @@ const createTimeout = (timeout: number, content: string): Timeout => { | ||
const connectTimeout = createTimeout( | ||
request.connectTimeout, | ||
'Connection timeout' | ||
); | ||
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout'); | ||
@@ -37,12 +32,6 @@ let responseTimeout: Timeout | undefined; | ||
baseRequester.onreadystatechange = (): void => { | ||
if ( | ||
baseRequester.readyState > baseRequester.OPENED && | ||
responseTimeout === undefined | ||
) { | ||
if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) { | ||
clearTimeout(connectTimeout); | ||
responseTimeout = createTimeout( | ||
request.responseTimeout, | ||
'Socket timeout' | ||
); | ||
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout'); | ||
} | ||
@@ -49,0 +38,0 @@ }; |
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
15152
349
+ Added@algolia/client-common@5.2.1(transitive)
- Removed@algolia/client-common@5.1.1(transitive)
Updated@algolia/client-common@5.2.1