Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@algolia/requester-browser-xhr

Package Overview
Dependencies
Maintainers
3
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/requester-browser-xhr - npm Package Compare versions

Comparing version 5.1.1 to 5.2.1

3

dist/requester-browser-xhr.esm.node.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc